rollup-plugins.mjs 594 B

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