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.
 
 
 

47 lines
939 B

  1. import pkg from './package.json';
  2. import commonjs from 'rollup-plugin-commonjs';
  3. import babel from 'rollup-plugin-babel';
  4. import postcss from 'rollup-plugin-postcss';
  5. import scss from 'rollup-plugin-scss';
  6. import bundleSize from 'rollup-plugin-bundle-size';
  7. import { terser } from 'rollup-plugin-terser';
  8. export default [
  9. // browser-friendly UMD build
  10. {
  11. input: 'src/js/index.js',
  12. output: {
  13. name: 'frappe-charts',
  14. file: pkg.browser,
  15. format: 'umd'
  16. },
  17. plugins: [
  18. commonjs(),
  19. babel({
  20. exclude: ['node_modules/**']
  21. }),
  22. terser(),
  23. scss({ output: 'dist/frappe-charts.min.css' }),
  24. bundleSize()
  25. ]
  26. },
  27. // CommonJS (for Node) and ES module (for bundlers) build.
  28. {
  29. input: 'src/js/chart.js',
  30. output: [
  31. { file: pkg.common, format: 'cjs' },
  32. { file: pkg.module, format: 'es' }
  33. ],
  34. plugins: [
  35. babel({
  36. exclude: ['node_modules/**']
  37. }),
  38. terser(),
  39. postcss(),
  40. bundleSize()
  41. ]
  42. }
  43. ];