mirror of
https://github.com/iconify/iconify.git
synced 2024-12-23 10:18:56 +00:00
65 lines
1.2 KiB
JavaScript
65 lines
1.2 KiB
JavaScript
import resolve from '@rollup/plugin-node-resolve';
|
|
import typescript from '@rollup/plugin-typescript';
|
|
|
|
// Directories
|
|
const targetDir = 'dist';
|
|
const sourceDir = 'src';
|
|
|
|
const mjsExt = '.js';
|
|
const cjsExt = '.cjs';
|
|
|
|
const resolveParams = {
|
|
extensions: ['.ts', '.mjs', '.js', '.cjs', '.svelte'],
|
|
dedupe: ['svelte'],
|
|
};
|
|
|
|
// Create bundle
|
|
export default [
|
|
// Files included in Icon.svelte as bundle
|
|
{
|
|
input: `${sourceDir}/functions.ts`,
|
|
output: [
|
|
{
|
|
file: `${targetDir}/functions${mjsExt}`,
|
|
format: 'es',
|
|
},
|
|
{
|
|
file: `${targetDir}/functions${cjsExt}`,
|
|
format: 'cjs',
|
|
},
|
|
],
|
|
plugins: [
|
|
resolve(resolveParams),
|
|
typescript({
|
|
tsconfig: 'tsconfig.src.json',
|
|
compilerOptions: {
|
|
outDir: `./${targetDir}`,
|
|
},
|
|
}),
|
|
],
|
|
},
|
|
// Files included in OfflineIcon.svelte as bundle
|
|
{
|
|
input: `${sourceDir}/offline-functions.ts`,
|
|
output: [
|
|
{
|
|
file: `${targetDir}/offline-functions${mjsExt}`,
|
|
format: 'es',
|
|
},
|
|
{
|
|
file: `${targetDir}/offline-functions${cjsExt}`,
|
|
format: 'cjs',
|
|
},
|
|
],
|
|
plugins: [
|
|
resolve(resolveParams),
|
|
typescript({
|
|
tsconfig: 'tsconfig.src.json',
|
|
compilerOptions: {
|
|
outDir: `./${targetDir}`,
|
|
},
|
|
}),
|
|
],
|
|
},
|
|
];
|