rollup.config.js 846 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import svelte from "rollup-plugin-svelte";
  2. import externals from 'rollup-plugin-node-externals'
  3. import { VERSION } from './src/version'
  4. const production = VERSION.production
  5. export default [
  6. {
  7. input: [
  8. "src/main.js",
  9. "src/index.js"
  10. ],
  11. output: [
  12. {
  13. sourcemap: !production,
  14. dir: "build",
  15. format: "cjs",
  16. }
  17. ],
  18. plugins: [
  19. svelte({
  20. dev: !production,
  21. css: function (css) {
  22. css.write('bundle.css');
  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. ],
  31. onwarn (warning, warn) {
  32. if (warning.code === 'CIRCULAR_DEPENDENCY') return;
  33. warn(warning);
  34. }
  35. }
  36. ];