@linjiajian999/esbuild-plugin-import
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i @linjiajian999/esbuild-plugin-import

Weekly Downloads

1,001

Version

1.0.2

License

MIT

Unpacked Size

25.8 kB

Total Files

15

Last publish

Collaborators

  • linjiajian999