rollup-plugins.mjs 666 B

1234567891011121314151617181920212223
  1. import bundleSize from '@atomico/rollup-plugin-sizes'
  2. import { visualizer } from 'rollup-plugin-visualizer'
  3. import license from 'rollup-plugin-license'
  4. import esbuild from 'rollup-plugin-esbuild'
  5. export const getRollupPlugins = (pkg, minify) => {
  6. return [
  7. esbuild({
  8. minify
  9. }),
  10. license({
  11. banner: `@license ${pkg.name} v${pkg.version} - ${pkg.license}
  12. This source code is licensed under the ${pkg.license} license.
  13. See the LICENSE file in the root directory of this source tree.`
  14. }),
  15. bundleSize(),
  16. visualizer({
  17. sourcemap: false,
  18. filename: `stats/${pkg.name}${minify ? '-min' : ''}.html`
  19. })
  20. ].filter(Boolean)
  21. }