rollup.config.js 825 B

12345678910111213141516171819202122232425262728293031323334353637
  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. onwarn: (warning, handler) => {
  24. if (warning.code === 'a11y-label-has-associated-control') return;
  25. handler(warning);
  26. }
  27. }),
  28. externals({deps: true})
  29. ],
  30. onwarn (warning, warn) {
  31. if (warning.code === 'CIRCULAR_DEPENDENCY') return;
  32. warn(warning);
  33. }
  34. }
  35. ];