Files
lucide/tools/rollup-plugins/plugins.js
Eric Fennis ad1accb2e3 refactor: Adds repo shared package @lucide/shared (#1904)
* Fixed import of toKebabCase helper function

* Added utils package

* utils

* Make utils package work in build

* Add lucide-shared

* Transpile solid with esbuild

* Fix resolve modules

* Cleanup

* Format files

* Fix properties plugins function

* Fix properties plugins in lucide package

* Revert remove resolve plugin and cleanup

* Update snapshots

* Revert icon changes

---------

Co-authored-by: Rohan <rohancrrm@gmail.com>
2024-03-06 21:03:12 +01:00

37 lines
1.1 KiB
JavaScript

/* eslint-disable import/no-extraneous-dependencies */
import { visualizer } from 'rollup-plugin-visualizer';
import bundleSize from '@atomico/rollup-plugin-sizes';
import replace from '@rollup/plugin-replace';
import license from 'rollup-plugin-license';
import esbuild from 'rollup-plugin-esbuild';
import { nodeResolve } from '@rollup/plugin-node-resolve';
const plugins = ({ pkg, minify = false, withEsbuild = true, esbuildOptions = {} }) =>
[
withEsbuild
? esbuild({
minify,
...esbuildOptions,
})
: null,
nodeResolve({
extensions: ['.js', '.ts', '.jsx', '.tsx'],
resolveOnly: [/^@lucide\/.*$/],
}),
license({
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.`,
}),
bundleSize(),
visualizer({
sourcemap: true,
filename: `stats/${pkg.name}${minify ? '-min' : ''}.html`,
}),
].filter(Boolean);
export { bundleSize, license, visualizer, replace };
export default plugins;