Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/lucide-preact/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ const configs = bundles
name: packageName,
...(preserveModules
? {
dir: `${outputDir}/${format}`,
}
dir: `${outputDir}/${format}`,
}
: {
file: `${outputDir}/${format}/${outputFileName}.js`,
}),
file: `${outputDir}/${format}/${outputFileName}.js`,
}),
preserveModules,
format,
sourcemap: true,
Expand Down
12 changes: 10 additions & 2 deletions packages/lucide-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ const bundles = [
},
{
format: 'esm',
inputs: [...inputs, , 'src/dynamicIconImports.ts', 'src/DynamicIcon.ts', ...aliasesEntries],
inputs,
outputDir: 'dist/esm',
preserveModules: true,
},

{
format: 'esm',
inputs: ['src/dynamicIconImports.ts', 'src/DynamicIcon.ts', ...aliasesEntries],
outputDir: 'dist/esm',
external: [/src/],
preserveModules: true,
},
{
Expand Down Expand Up @@ -55,7 +63,7 @@ const configs = bundles
...plugins({ pkg, minify }),
// Make sure we emit "use client" directive to make it compatible with Next.js
preserveDirectives({
include: 'src/DynamicIcon.ts',
include: ['src/DynamicIcon.ts', 'src/context.ts', 'src/Icon.ts'],
suppressPreserveModulesWarning: true,
}),
],
Expand Down
2 changes: 2 additions & 0 deletions packages/lucide-react/src/Icon.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use-client';

import { createElement, forwardRef } from 'react';
import defaultAttributes from './defaultAttributes';
import { IconNode, LucideProps } from './types';
Expand Down
2 changes: 2 additions & 0 deletions packages/lucide-react/src/context.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use-client';

import { createContext, createElement, type ReactNode, useContext, useMemo } from 'react';
import { LucideProps } from './types';

Expand Down
Loading