A SWC plugin to use path mapping. This may be needed in other plugins.
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/
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/*"]
}
}
]
]
}
}
}
This don't support multiple fall back locations.
{
"paths": {
"*": ["*", "generated/*"] // ⛔ don't support
}
}