1.0.0 ā€¢ Published 4 months ago

esbuild-plugin-import-transform v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

esbuild-plugin-import-transform

npm version npm downloads

āœØ Transform imports in esbuild

šŸ“¦ Installation

npm install -D esbuild esbuild-plugin-import-transform

šŸ“š Usage

Add this to your build file

import { build } from "esbuild";
import importTransform from "esbuild-plugin-import-transform";

const yourConfig = {};

await build({
  ...yourConfig,
  plugins: [
    importTransform({
      "imported-module": "imported-module/dist/index.js",

      // This will transform all imports from "node:path" to "path-browserify"
      // when esbuilds platform is set to "browser"
      "node:path": {
        platform: "browser",
        to: "path-browserify"
      },

      "./locate": {
        text: "export function locate() { return \"found\" }"
      },

      // will transform all imports from "./utils" to "./lib/utils2"
      "./utils": "./lib/utils2"
    })
  ]
});

šŸ“„ License

Published under MIT License.

1.0.0

4 months ago

0.2.1

11 months ago

0.2.0

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago