mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-17 00:57:41 +01:00
* init svelte project * Add export script for lucide-svelte * make lucide-svelte wokring * make ready for first release * update lock file * bump version * some fixes in the build * Add tests * Finish tests * Update Readme * update lock file * Add svelte to gh actions * Add svetle to website docs * Add test ci script * adjust action * add on PR trigger * remove dep * fix tests * Add svelte entry in package.json * update snapshots
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
/* eslint-disable import/no-extraneous-dependencies */
|
|
import babel from '@rollup/plugin-babel';
|
|
import bundleSize from '@atomico/rollup-plugin-sizes';
|
|
import compiler from '@ampproject/rollup-plugin-closure-compiler';
|
|
import { terser } from 'rollup-plugin-terser';
|
|
import visualizer from 'rollup-plugin-visualizer';
|
|
import license from 'rollup-plugin-license';
|
|
import replace from '@rollup/plugin-replace';
|
|
import resolve from '@rollup/plugin-node-resolve';
|
|
import commonJS from '@rollup/plugin-commonjs';
|
|
|
|
const plugins = (pkg, minify) =>
|
|
[
|
|
replace({
|
|
'icons = {}': 'icons = allIcons',
|
|
delimiters: ['', ''],
|
|
preventAssignment: false,
|
|
}),
|
|
resolve(),
|
|
commonJS({
|
|
include: 'node_modules/**',
|
|
}),
|
|
babel({
|
|
babelHelpers: 'bundled',
|
|
}),
|
|
// The two minifiers together seem to procude a smaller bundle 🤷♂️
|
|
minify && compiler(),
|
|
minify && terser(),
|
|
license({
|
|
banner: `${pkg.name} v${pkg.version} - ${pkg.license}`,
|
|
}),
|
|
bundleSize(),
|
|
visualizer({
|
|
sourcemap: true,
|
|
filename: `stats/${pkg.name}${minify ? '-min' : ''}.html`,
|
|
}),
|
|
].filter(Boolean);
|
|
|
|
export default plugins;
|