Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lucide-solid): compilation issues when starting up Vite Dev server #2375

Merged
merged 4 commits into from
Aug 23, 2024
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
13 changes: 13 additions & 0 deletions docs/guide/packages/lucide-solid.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ const App = () => {
export default App;
```

Vite loading/performing issues with the dev server can be resolved by import icons directly from the `lucide-solid/icons` directory:

```jsx
import Camera from 'lucide-solid/icons/camera';

// Usage
const App = () => {
return <Camera color="red" size={48} />;
};

export default App;
```

## Props

| name | type | default |
Expand Down
18 changes: 17 additions & 1 deletion packages/lucide-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@
"browser": "./dist/esm/lucide-solid.js",
"require": "./dist/cjs/lucide-solid.js",
"node": "./dist/cjs/lucide-solid.js"
},
"./icons": {
"types": "./dist/types/lucide-solid.d.ts",
"solid": "./dist/source/lucide-solid.jsx",
"import": "./dist/esm/lucide-solid.js",
"browser": "./dist/esm/lucide-solid.js",
"require": "./dist/cjs/lucide-solid.js",
"node": "./dist/cjs/lucide-solid.js"
},
"./icons/*": {
"types": "./dist/types/icons/*.d.ts",
"solid": "./dist/source/icons/*.jsx",
"import": "./dist/esm/icons/*.js",
"browser": "./dist/esm/icons/*.js",
"require": "./dist/cjs/icons/*.js",
"node": "./dist/cjs/icons/*.js"
}
},
"sideEffects": false,
Expand All @@ -48,7 +64,7 @@
"build:transpile": "tsc --jsx preserve -t es2020 --rootDir src --outDir dist --noEmit false",
"build:version": "node ./scripts/replaceVersion.mjs",
"build:bundle": "rollup -c rollup.config.mjs",
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --renderUniqueKey --withAliases --aliasesFileExtension=.ts --iconFileExtension=.tsx --exportFileName=index.ts",
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --renderUniqueKey --withAliases --separateAliasesFile --aliasesFileExtension=.ts --iconFileExtension=.tsx --exportFileName=index.ts",
"test": "pnpm build:icons && vitest run",
"version": "pnpm version --git-tag-version=false"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/lucide-solid/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ const bundles = [
format: 'cjs',
inputs,
outputDir,
preserveModules: true,
},
{
format: 'esm',
inputs,
outputDir,
preserveModules: true,
},
];

Expand Down
Loading