rollup.config.js 533 B

12345678910111213141516171819202122232425262728
  1. import { nodeResolve } from '@rollup/plugin-node-resolve'
  2. const onwarn = (warning) => {
  3. // Silence circular dependency warning for moment package
  4. if (warning.code === 'CIRCULAR_DEPENDENCY') {
  5. return
  6. }
  7. console.warn(`(!) ${warning.message}`)
  8. }
  9. export default {
  10. input: 'src/index.js',
  11. output: [
  12. {
  13. file: 'dist/index.js',
  14. format: 'module',
  15. sourcemap: true
  16. },
  17. {
  18. file: 'dist/index.cjs',
  19. format: 'commonjs',
  20. sourcemap: true
  21. }
  22. ],
  23. plugins: [nodeResolve()],
  24. onwarn
  25. }