diff --git a/package.json b/package.json index a251f34..1fcd46a 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "npm-run-all": "^4.1.5", "rollup": "^1.10.1", "rollup-plugin-commonjs": "^9.3.4", + "rollup-plugin-livereload": "^1.0.0", "rollup-plugin-node-resolve": "^4.2.3", "rollup-plugin-svelte": "^5.0.3", "rollup-plugin-terser": "^4.0.4", diff --git a/rollup.config.js b/rollup.config.js index 0c83c8b..c58c822 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,7 @@ import svelte from 'rollup-plugin-svelte'; import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; +import livereload from 'rollup-plugin-livereload'; import { terser } from 'rollup-plugin-terser'; const production = !process.env.ROLLUP_WATCH; @@ -32,6 +33,10 @@ export default { resolve(), 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 // instead of npm run dev), minify production && terser()