Files
lucide/tools/rollup-plugins/plugins.js
T

30 lines
873 B
JavaScript
Raw Permalink Normal View History

2021-03-23 19:26:50 +01:00
/* eslint-disable import/no-extraneous-dependencies */
import { visualizer } from 'rollup-plugin-visualizer';
2023-01-17 08:04:34 +01:00
import bundleSize from '@atomico/rollup-plugin-sizes';
import replace from '@rollup/plugin-replace';
2021-03-23 19:26:50 +01:00
import license from 'rollup-plugin-license';
import esbuild from 'rollup-plugin-esbuild';
2020-12-02 13:48:39 +01:00
2023-01-17 08:04:34 +01:00
const plugins = (pkg, minify, esbuildOptions = {}) =>
2020-12-02 13:48:39 +01:00
[
esbuild({
minify,
2023-01-17 08:04:34 +01:00
...esbuildOptions,
2020-12-02 13:48:39 +01:00
}),
license({
2023-11-17 11:12:31 +01:00
banner: `@license ${pkg.name} v${pkg.version} - ${pkg.license}
This source code is licensed under the ${pkg.license} license.
See the LICENSE file in the root directory of this source tree.`,
2020-12-02 13:48:39 +01:00
}),
bundleSize(),
visualizer({
sourcemap: true,
filename: `stats/${pkg.name}${minify ? '-min' : ''}.html`,
}),
].filter(Boolean);
2023-01-17 08:04:34 +01:00
export { bundleSize, license, visualizer, replace };
2021-03-23 19:26:50 +01:00
export default plugins;