Skip to content

Modularly import plugin for esbuild, similar to babel-plugin-import

License

Notifications You must be signed in to change notification settings

linjiajian999/esbuild-plugin-import

Repository files navigation

esbuild-plugin-import

Modularly import plugin for esbuild.

inspired by ant-design/babel-plugin-import

Example

import { Button } from 'antd';

// 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 👇🏻 //

import 'antd/lib/button/style/css';
import Button from 'antd/lib/button';

Usage

npm install @linjiajian999/esbuild-plugin-import

config

options

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)[];
}

libraryName

todo

Contributors

This project exists thanks to all the people who contribute.

contributors

About

Modularly import plugin for esbuild, similar to babel-plugin-import

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published