swc-plugin-pre-paths
v1.0.0
Published
A [SWC](https://swc.rs) plugin to use [path mapping](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping). This may be needed in other plugins.
Downloads
161
Readme
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
You can check the compatibility of versions on https://plugins.swc.rs/
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
}
}