Skip to content

Commit 222cadd

Browse files
update package, rollup config and use export in main
1 parent a157214 commit 222cadd

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
"name": "svelte-app",
33
"version": "1.0.0",
44
"devDependencies": {
5-
"rollup": "^0.47.6",
5+
"rollup": "^0.49.3",
66
"rollup-plugin-buble": "^0.15.0",
7-
"rollup-plugin-commonjs": "^8.1.0",
7+
"rollup-plugin-commonjs": "^8.2.1",
88
"rollup-plugin-node-resolve": "^3.0.0",
99
"rollup-plugin-svelte": "^3.1.0",
1010
"rollup-plugin-uglify": "^2.0.1",
11-
"rollup-watch": "^4.3.1",
1211
"serve": "^6.0.6"
1312
},
1413
"scripts": {

rollup.config.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ import uglify from 'rollup-plugin-uglify';
77
const production = !process.env.ROLLUP_WATCH;
88

99
export default {
10-
entry: 'src/main.js',
11-
dest: 'public/bundle.js',
12-
format: 'iife',
13-
moduleName: 'app',
14-
sourceMap: true,
10+
input: 'src/main.js',
11+
output: {
12+
sourcemap: true,
13+
format: 'iife',
14+
file: 'public/bundle.js'
15+
},
16+
name: 'app',
1517
plugins: [
1618
svelte({
19+
// enable run-time checks when not in production
20+
dev: !production,
1721
// we'll extract any component CSS out into
1822
// a separate file — better for performance
1923
css: css => {

src/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import App from './App.html';
22

3-
window.app = new App({
3+
const app = new App({
44
target: document.body,
55
data: {
66
name: 'world'
77
}
8-
});
8+
});
9+
10+
export default app;

0 commit comments

Comments
 (0)