rollup.config.js 895 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import svelte from "rollup-plugin-svelte";
  2. import externals from 'rollup-plugin-node-externals'
  3. import css from 'rollup-plugin-css-only'
  4. import { VERSION } from './src/version'
  5. const production = VERSION.production
  6. export default [
  7. {
  8. input: [
  9. "src/main.js",
  10. "src/index.js"
  11. ],
  12. output: [
  13. {
  14. sourcemap: !production,
  15. dir: "build",
  16. format: "cjs",
  17. }
  18. ],
  19. plugins: [
  20. svelte({
  21. compilerOptions: {
  22. dev: VERSION.production
  23. },
  24. onwarn: (warning, handler) => {
  25. // if (warning.code === 'a11y-label-has-associated-control') return;
  26. handler(warning);
  27. }
  28. }),
  29. externals({deps: true}),
  30. css({output: 'bundle.css'})
  31. ],
  32. onwarn (warning, warn) {
  33. if (warning.code === 'CIRCULAR_DEPENDENCY') return;
  34. warn(warning);
  35. }
  36. }
  37. ];