Skip to content

Commit

Permalink
Merge pull request sveltejs#1 from antonheryanto/master
Browse files Browse the repository at this point in the history
update package, rollup config and use export in main
  • Loading branch information
Rich-Harris authored Sep 8, 2017
2 parents a157214 + 222cadd commit 8655d37
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"name": "svelte-app",
"version": "1.0.0",
"devDependencies": {
"rollup": "^0.47.6",
"rollup": "^0.49.3",
"rollup-plugin-buble": "^0.15.0",
"rollup-plugin-commonjs": "^8.1.0",
"rollup-plugin-commonjs": "^8.2.1",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-svelte": "^3.1.0",
"rollup-plugin-uglify": "^2.0.1",
"rollup-watch": "^4.3.1",
"serve": "^6.0.6"
},
"scripts": {
Expand Down
14 changes: 9 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ import uglify from 'rollup-plugin-uglify';
const production = !process.env.ROLLUP_WATCH;

export default {
entry: 'src/main.js',
dest: 'public/bundle.js',
format: 'iife',
moduleName: 'app',
sourceMap: true,
input: 'src/main.js',
output: {
sourcemap: true,
format: 'iife',
file: 'public/bundle.js'
},
name: 'app',
plugins: [
svelte({
// enable run-time checks when not in production
dev: !production,
// we'll extract any component CSS out into
// a separate file — better for performance
css: css => {
Expand Down
6 changes: 4 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import App from './App.html';

window.app = new App({
const app = new App({
target: document.body,
data: {
name: 'world'
}
});
});

export default app;

0 comments on commit 8655d37

Please sign in to comment.