Merge pull request #1 from antonheryanto/master
update package, rollup config and use export in main
This commit is contained in:
commit
8655d376b8
3 changed files with 15 additions and 10 deletions
|
@ -2,13 +2,12 @@
|
||||||
"name": "svelte-app",
|
"name": "svelte-app",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"rollup": "^0.47.6",
|
"rollup": "^0.49.3",
|
||||||
"rollup-plugin-buble": "^0.15.0",
|
"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-node-resolve": "^3.0.0",
|
||||||
"rollup-plugin-svelte": "^3.1.0",
|
"rollup-plugin-svelte": "^3.1.0",
|
||||||
"rollup-plugin-uglify": "^2.0.1",
|
"rollup-plugin-uglify": "^2.0.1",
|
||||||
"rollup-watch": "^4.3.1",
|
|
||||||
"serve": "^6.0.6"
|
"serve": "^6.0.6"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -7,13 +7,17 @@ import uglify from 'rollup-plugin-uglify';
|
||||||
const production = !process.env.ROLLUP_WATCH;
|
const production = !process.env.ROLLUP_WATCH;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
entry: 'src/main.js',
|
input: 'src/main.js',
|
||||||
dest: 'public/bundle.js',
|
output: {
|
||||||
format: 'iife',
|
sourcemap: true,
|
||||||
moduleName: 'app',
|
format: 'iife',
|
||||||
sourceMap: true,
|
file: 'public/bundle.js'
|
||||||
|
},
|
||||||
|
name: 'app',
|
||||||
plugins: [
|
plugins: [
|
||||||
svelte({
|
svelte({
|
||||||
|
// enable run-time checks when not in production
|
||||||
|
dev: !production,
|
||||||
// we'll extract any component CSS out into
|
// we'll extract any component CSS out into
|
||||||
// a separate file — better for performance
|
// a separate file — better for performance
|
||||||
css: css => {
|
css: css => {
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
import App from './App.html';
|
import App from './App.html';
|
||||||
|
|
||||||
window.app = new App({
|
const app = new App({
|
||||||
target: document.body,
|
target: document.body,
|
||||||
data: {
|
data: {
|
||||||
name: 'world'
|
name: 'world'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default app;
|
Loading…
Reference in a new issue