diff --git a/package.json b/package.json index e9e9def3..c2e303ea 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,9 @@ "@rollup/plugin-commonjs": "^14.0.0", "@rollup/plugin-node-resolve": "^8.0.0", "rollup": "^2.3.4", + "rollup-plugin-css-only": "^3.0.0", "rollup-plugin-livereload": "^2.0.0", - "rollup-plugin-svelte": "^6.0.0", + "rollup-plugin-svelte": "^7.0.0", "rollup-plugin-terser": "^7.0.0", "svelte": "^3.0.0" }, diff --git a/rollup.config.js b/rollup.config.js index ecdc6273..5bcb51cb 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,14 +1,15 @@ import svelte from 'rollup-plugin-svelte'; -import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; +import resolve from '@rollup/plugin-node-resolve'; import livereload from 'rollup-plugin-livereload'; import { terser } from 'rollup-plugin-terser'; +import css from 'rollup-plugin-css-only'; const production = !process.env.ROLLUP_WATCH; function serve() { let server; - + function toExit() { if (server) server.kill(0); } @@ -38,13 +39,13 @@ export default { 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 => { - css.write('bundle.css'); + compilerOptions: { + dev: !production } }), + // we'll extract any component CSS out into + // a separate file - better for performance + css({ output: 'bundle.css' }), // If you have external dependencies installed from // npm, you'll most likely need these plugins. In