Shopping List v2.0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rollup.config.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import svelte from 'rollup-plugin-svelte';
  2. import resolve from 'rollup-plugin-node-resolve';
  3. import commonjs from 'rollup-plugin-commonjs';
  4. import { terser } from 'rollup-plugin-terser';
  5. const production = !process.env.NODE_ENV || process.env.NODE_ENV == "production";
  6. export default {
  7. input: 'src/main.js',
  8. output: {
  9. sourcemap: !production,
  10. format: 'iife',
  11. name: 'app',
  12. file: 'public/bundle.js'
  13. },
  14. plugins: [
  15. svelte({
  16. // enable run-time checks when not in production
  17. dev: !production,
  18. // we'll extract any component CSS out into
  19. // a separate file — better for performance
  20. css: css => {
  21. css.write('public/bundle.css');
  22. }
  23. }),
  24. // If you have external dependencies installed from
  25. // npm, you'll most likely need these plugins. In
  26. // some cases you'll need additional configuration —
  27. // consult the documentation for details:
  28. // https://github.com/rollup/rollup-plugin-commonjs
  29. resolve({ browser: true }),
  30. commonjs(),
  31. // If we're building for production (npm run build
  32. // instead of npm run dev), minify
  33. production && terser()
  34. ],
  35. };