Merge pull request #1 from antonheryanto/master

update package, rollup config and use export in main
This commit is contained in:
Rich Harris 2017-09-08 07:07:16 -04:00 committed by GitHub
commit 8655d376b8
3 changed files with 15 additions and 10 deletions

View file

@ -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": {

View file

@ -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 => {

View file

@ -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;