diff --git a/package.json b/package.json index 61e5dbf..297dd7c 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/rollup.config.js b/rollup.config.js index 2d9ed69..5a323cb 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -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 => { diff --git a/src/main.js b/src/main.js index e729d4a..c804cee 100644 --- a/src/main.js +++ b/src/main.js @@ -1,8 +1,10 @@ import App from './App.html'; -window.app = new App({ +const app = new App({ target: document.body, data: { name: 'world' } -}); \ No newline at end of file +}); + +export default app; \ No newline at end of file