Modularly import plugin for esbuild.
inspired by ant-design/babel-plugin-import
import { Button } from 'antd';
// 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 //
import 'antd/lib/button/style/css';
import Button from 'antd/lib/button';
npm install @linjiajian999/esbuild-plugin-import
export interface EsbuildPluginImportOption {
libraryName: string;
/**
* @default 'lib'
*/
libraryDirectory?: string;
style?:
| 'css'
| boolean
| ((importName: string, importPath: string) => string);
styleLibraryDirectory?: string;
customStyleName?: string;
/**
* @default true
*/
camel2DashComponentName?: boolean;
camel2UnderlineComponentName?: boolean;
/**
* @default true
*/
transformToDefaultImport?: boolean;
ignoreImports?: (RegExp | string)[];
}
todo
This project exists thanks to all the people who contribute.