2023-01-17 08:04:34 +01:00
|
|
|
import plugins, { replace } from '@lucide/rollup-plugins';
|
2025-03-14 11:29:59 +01:00
|
|
|
import pkg from './package.json' with { type: 'json' };
|
2024-02-01 22:38:21 +09:00
|
|
|
import dts from 'rollup-plugin-dts';
|
2021-05-20 21:24:54 +02:00
|
|
|
|
|
|
|
|
const packageName = 'LucideVueNext';
|
|
|
|
|
const outputFileName = 'lucide-vue-next';
|
2022-08-10 09:10:53 +02:00
|
|
|
const outputDir = 'dist';
|
2022-12-04 22:38:56 +01:00
|
|
|
const inputs = ['src/lucide-vue-next.ts'];
|
2021-05-20 21:24:54 +02:00
|
|
|
const bundles = [
|
|
|
|
|
{
|
|
|
|
|
format: 'cjs',
|
|
|
|
|
inputs,
|
|
|
|
|
outputDir,
|
2022-12-04 22:38:56 +01:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
format: 'esm',
|
|
|
|
|
inputs,
|
|
|
|
|
outputDir,
|
|
|
|
|
preserveModules: true,
|
|
|
|
|
},
|
2021-05-20 21:24:54 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const configs = bundles
|
2025-08-01 12:47:22 +02:00
|
|
|
.map(({ inputs, outputDir, format, preserveModules }) =>
|
2024-02-01 22:38:21 +09:00
|
|
|
inputs.map((input) => ({
|
2021-05-20 21:24:54 +02:00
|
|
|
input,
|
2025-08-01 12:47:22 +02:00
|
|
|
plugins: plugins({ pkg }),
|
2021-05-20 21:24:54 +02:00
|
|
|
external: ['vue'],
|
|
|
|
|
output: {
|
|
|
|
|
name: packageName,
|
2022-12-04 22:38:56 +01:00
|
|
|
...(preserveModules
|
|
|
|
|
? {
|
|
|
|
|
dir: `${outputDir}/${format}`,
|
|
|
|
|
}
|
|
|
|
|
: {
|
2025-08-01 12:47:22 +02:00
|
|
|
file: `${outputDir}/${format}/${outputFileName}.js`,
|
2022-12-04 22:38:56 +01:00
|
|
|
}),
|
2021-05-20 21:24:54 +02:00
|
|
|
format,
|
2022-12-04 22:38:56 +01:00
|
|
|
preserveModules,
|
2024-03-06 21:03:12 +01:00
|
|
|
preserveModulesRoot: 'src',
|
2021-05-20 21:24:54 +02:00
|
|
|
sourcemap: true,
|
|
|
|
|
globals: {
|
|
|
|
|
vue: 'vue',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})),
|
|
|
|
|
)
|
|
|
|
|
.flat();
|
|
|
|
|
|
2024-02-01 22:38:21 +09:00
|
|
|
export default [
|
|
|
|
|
{
|
|
|
|
|
input: inputs[0],
|
|
|
|
|
output: [
|
|
|
|
|
{
|
|
|
|
|
file: `dist/${outputFileName}.d.ts`,
|
|
|
|
|
format: 'es',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
plugins: [
|
|
|
|
|
dts({
|
|
|
|
|
compilerOptions: {
|
|
|
|
|
preserveSymlinks: false,
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
},
|
2024-11-08 16:47:53 +01:00
|
|
|
{
|
|
|
|
|
input: `src/${outputFileName}.suffixed.ts`,
|
|
|
|
|
output: [
|
|
|
|
|
{
|
|
|
|
|
file: `dist/${outputFileName}.suffixed.d.ts`,
|
|
|
|
|
format: 'es',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
plugins: [
|
|
|
|
|
dts({
|
|
|
|
|
compilerOptions: {
|
|
|
|
|
preserveSymlinks: false,
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
input: `src/${outputFileName}.prefixed.ts`,
|
|
|
|
|
output: [
|
|
|
|
|
{
|
|
|
|
|
file: `dist/${outputFileName}.prefixed.d.ts`,
|
|
|
|
|
format: 'es',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
plugins: [
|
|
|
|
|
dts({
|
|
|
|
|
compilerOptions: {
|
|
|
|
|
preserveSymlinks: false,
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
},
|
2024-02-01 22:38:21 +09:00
|
|
|
...configs,
|
|
|
|
|
];
|