Skip to content

Commit

Permalink
Generate ESM/CJS variants of dynamicIconImports
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-lee committed Sep 6, 2024
1 parent ef090c7 commit 643cd95
Show file tree
Hide file tree
Showing 3 changed files with 14,227 additions and 12,057 deletions.
2 changes: 2 additions & 0 deletions packages/lucide-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"dist",
"dynamicIconImports.js",
"dynamicIconImports.js.map",
"dynamicIconImports.mjs",
"dynamicIconImports.mjs.map",
"dynamicIconImports.d.ts"
],
"scripts": {
Expand Down
13 changes: 13 additions & 0 deletions packages/lucide-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ const bundles = [
{
format: 'esm',
inputs: ['src/dynamicIconImports.ts'],
outputFile: 'dynamicIconImports.mjs',
external: [/src/],
paths: (id) => {
if (id.match(/src/)) {
const [, modulePath] = id.match(/src\/(.*)\.ts/);

return `dist/esm/${modulePath}.mjs`;
}
},
},
{
format: 'cjs',
inputs: ['src/dynamicIconImports.ts'],
outputFile: 'dynamicIconImports.js',
external: [/src/],
paths: (id) => {
Expand Down
Loading

0 comments on commit 643cd95

Please sign in to comment.