Feat: Include rollup-plugin-livereload for development (#22)

This commit is contained in:
Emil Tholin 2019-04-30 06:02:41 +02:00 committed by Luke Edwards
parent 66c3c30c5d
commit 642f49d938
2 changed files with 6 additions and 0 deletions

View file

@ -5,6 +5,7 @@
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"rollup": "^1.10.1", "rollup": "^1.10.1",
"rollup-plugin-commonjs": "^9.3.4", "rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-livereload": "^1.0.0",
"rollup-plugin-node-resolve": "^4.2.3", "rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-svelte": "^5.0.3", "rollup-plugin-svelte": "^5.0.3",
"rollup-plugin-terser": "^4.0.4", "rollup-plugin-terser": "^4.0.4",

View file

@ -1,6 +1,7 @@
import svelte from 'rollup-plugin-svelte'; import svelte from 'rollup-plugin-svelte';
import resolve from 'rollup-plugin-node-resolve'; import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs'; import commonjs from 'rollup-plugin-commonjs';
import livereload from 'rollup-plugin-livereload';
import { terser } from 'rollup-plugin-terser'; import { terser } from 'rollup-plugin-terser';
const production = !process.env.ROLLUP_WATCH; const production = !process.env.ROLLUP_WATCH;
@ -32,6 +33,10 @@ export default {
resolve(), resolve(),
commonjs(), commonjs(),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!production && livereload('public'),
// If we're building for production (npm run build // If we're building for production (npm run build
// instead of npm run dev), minify // instead of npm run dev), minify
production && terser() production && terser()