swc-plugin-pre-paths
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

swc-plugin-pre-paths

A SWC plugin to use path mapping. This may be needed in other plugins.

Installation

npm:

npm i -D swc-plugin-pre-paths

yarn:

yarn add -D swc-plugin-pre-paths

Usage

Via .swcrc

{
  "jsc": {
    "experimental": {
      "plugins": [
        [
          "swc-plugin-pre-paths",
          {
            "baseUrl": ".",
            "paths": {
              "app/*": ["./src/app/*"],
              "config/*": ["./src/app/_config/*"],
              "environment/*": ["./src/environments/*"],
              "shared/*": ["./src/app/_shared/*"],
              "helpers/*": ["./src/helpers/*"],
              "tests/*": ["./src/tests/*"]
            }
          }
        ]
      ]
    }
  }
}

Limits

This don't support multiple fall back locations.

{
  "paths": {
    "*": ["*", "generated/*"] // ⛔ don't support
  }
}

Readme

Keywords

Package Sidebar

Install

npm i swc-plugin-pre-paths

Weekly Downloads

57

Version

0.1.6

License

MIT

Unpacked Size

4.02 MB

Total Files

4

Last publish

Collaborators

  • vkcom-publisher