2023-01-18 22:49:53 +01:00
|
|
|
import plugins from '@lucide/rollup-plugins';
|
2024-02-01 22:38:21 +09:00
|
|
|
import dts from 'rollup-plugin-dts';
|
2025-03-14 11:29:59 +01:00
|
|
|
import pkg from './package.json' with { type: 'json' };
|
2022-06-12 22:31:05 +02:00
|
|
|
|
|
|
|
|
const packageName = 'LucideReact';
|
|
|
|
|
const outputFileName = 'lucide-react-native';
|
2022-08-10 09:10:53 +02:00
|
|
|
const outputDir = 'dist';
|
2022-12-04 22:38:56 +01:00
|
|
|
const inputs = ['src/lucide-react-native.ts'];
|
2022-06-12 22:31:05 +02:00
|
|
|
const bundles = [
|
|
|
|
|
{
|
|
|
|
|
format: 'cjs',
|
|
|
|
|
inputs,
|
|
|
|
|
outputDir,
|
|
|
|
|
preserveModules: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
format: 'esm',
|
|
|
|
|
inputs,
|
|
|
|
|
outputDir,
|
|
|
|
|
preserveModules: true,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const configs = bundles
|
|
|
|
|
.map(({ inputs, outputDir, format, minify, preserveModules }) =>
|
2024-02-01 22:38:21 +09:00
|
|
|
inputs.map((input) => ({
|
2022-06-12 22:31:05 +02:00
|
|
|
input,
|
2024-03-06 21:03:12 +01:00
|
|
|
plugins: plugins({ pkg, minify }),
|
2024-01-03 11:38:06 +01:00
|
|
|
external: ['react', 'react-native-svg'],
|
2022-06-12 22:31:05 +02:00
|
|
|
output: {
|
|
|
|
|
name: packageName,
|
|
|
|
|
...(preserveModules
|
|
|
|
|
? {
|
|
|
|
|
dir: `${outputDir}/${format}`,
|
2022-08-10 09:10:53 +02:00
|
|
|
exports: 'auto',
|
2022-06-12 22:31:05 +02:00
|
|
|
}
|
|
|
|
|
: {
|
|
|
|
|
file: `${outputDir}/${format}/${outputFileName}${minify ? '.min' : ''}.js`,
|
|
|
|
|
}),
|
|
|
|
|
format,
|
|
|
|
|
preserveModules,
|
|
|
|
|
sourcemap: true,
|
|
|
|
|
globals: {
|
|
|
|
|
react: 'react',
|
|
|
|
|
'react-native-svg': 'react-native-svg',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})),
|
|
|
|
|
)
|
|
|
|
|
.flat();
|
|
|
|
|
|
2024-02-01 22:38:21 +09:00
|
|
|
export default [
|
|
|
|
|
{
|
|
|
|
|
input: inputs[0],
|
|
|
|
|
output: [
|
|
|
|
|
{
|
|
|
|
|
file: `dist/${outputFileName}.d.ts`,
|
|
|
|
|
format: 'es',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
plugins: [dts()],
|
|
|
|
|
},
|
2024-11-08 16:47:53 +01:00
|
|
|
{
|
|
|
|
|
input: `src/${outputFileName}.suffixed.ts`,
|
|
|
|
|
output: [
|
|
|
|
|
{
|
|
|
|
|
file: `dist/${outputFileName}.suffixed.d.ts`,
|
|
|
|
|
format: 'es',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
plugins: [dts()],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
input: `src/${outputFileName}.prefixed.ts`,
|
|
|
|
|
output: [
|
|
|
|
|
{
|
|
|
|
|
file: `dist/${outputFileName}.prefixed.d.ts`,
|
|
|
|
|
format: 'es',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
plugins: [dts()],
|
|
|
|
|
},
|
2024-02-01 22:38:21 +09:00
|
|
|
...configs,
|
|
|
|
|
];
|