Vite plugin for modular import transformation, automatically converting named imports from a library into path-specific imports and optional style imports. Version 1.0.5 requires Vite >=2 and Node >=14. It uses acorn and es-module-lexer for faster transforms (claimed 90% faster than alternatives like vite-plugin-import and vite-plugin-importer). Inspired by babel-plugin-import, it supports the same options. TypeScript types are included. Release cadence is irregular.
npm install vite-plugin-importusNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures the plugin in vite.config.ts to transform antd named imports to path-specific imports with CSS.
Verify the exact path structure of the library (e.g., 'es' vs 'lib') and style entry (e.g., 'css' vs 'style/css').
Use static imports for the targeted library, or use a different plugin if you need dynamic import support.
Use the 'libraryName' and 'libraryPath' options to fine-tune; check library documentation for correct path.
Run 'npm install -D vite-plugin-importus' and ensure 'vite.config.ts' is included in tsconfig.
Double-check the 'libraryDirectory' (e.g., 'es', 'lib') and ensure the path exists in the node_modules library.
Ensure Vite >=2 is installed and that the plugin is listed in the plugins array, not nested.