
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
vite-plugin-transform-lucide-imports
Advanced tools
Core package for vite-plugin-transform-lucide-imports
Transform named lucide imports into default imports.
pnpm install vite-plugin-transform-lucide-imports -D
import { defineConfig } from "vite";
import transformLucideImports from "vite-plugin-transform-lucide-imports";
export default defineConfig({
plugins: [/* other framework plugins */, transformLucideImports()],
});
Before
import { LucideFizzIcon, BarIcon, Foo, Baz as Baz2Icon, type XIcon } from "lucide-react-native";
After
import type { XIcon } from "lucide-react-native";
import LucideFizzIcon from "lucide-react-native";
import BarIcon from "lucide-react-native/icons/bar";
import Foo from "lucide-react-native/icons/foo";
import Baz2Icon from "lucide-react-native/icons/baz";
https://github.com/user-attachments/assets/c2692f80-e8f6-4cb8-942d-8c109db49b5b
[!NOTE] If you are using any of the following lucide packages lucide, lucide-react, lucide-vue, lucide-vue-next, lucide-angular, lucide-preact they already support tree shaking and this plugin won't be necessary.
Named lucide imports have long been the cause of slow dev server performance. This plugin transforms them into default imports, which are much faster to resolve.
Named imports have a few advantages over default imports:
For frameworks that transpile to a valid JS / JSX syntax you can just pass your file extension to the extensions option of the plugin:
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import transformLucideImports, { SUPPORTED_EXTENSIONS } from "vite-plugin-transform-lucide-imports";
export default defineConfig({
// the plugin MUST be added after the plugin doing the transpilation
// you may also want to spread the supported extensions to continue to support other extensions
plugins: [vue(), transformLucideImports({ extensions: [...SUPPORTED_EXTENSIONS, ".vue"] })],
});
Feel free to contribute your frameworks extension!
By default the supported extensions are
.ts,.tsx,.js,.jsx,.mjs, and.svelte.
FAQs
Core package for vite-plugin-transform-lucide-imports
We found that vite-plugin-transform-lucide-imports demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.