rollup.config.js 671 B

123456789101112131415161718192021222324252627282930313233
  1. import svelte from "rollup-plugin-svelte";
  2. import externals from 'rollup-plugin-node-externals'
  3. const production = process.env.NODE_ENV !== "development";
  4. export default [
  5. {
  6. input: [
  7. "src/main.js",
  8. "src/index.js"
  9. ],
  10. output: [
  11. {
  12. sourcemap: !production,
  13. dir: "build",
  14. format: "cjs",
  15. }
  16. ],
  17. plugins: [
  18. svelte({
  19. dev: !production,
  20. css: css => {
  21. css.write("build/bundle.css");
  22. },
  23. }),
  24. externals({deps: true})
  25. ],
  26. onwarn (warning, warn) {
  27. if (warning.code === 'CIRCULAR_DEPENDENCY') return;
  28. warn(warning);
  29. }
  30. }
  31. ];