@flatjs/forge-plugin-ts-paths
v2.1.4
Published
faltjs plugin to automatically resolve path aliases set in the compilerOptions section of tsconfig.json. Don't use it if you're already using rollup-plugin-typescript. This plugin is only for use cases where your TypeScript code has already been transpile
Downloads
371
Readme
@flatjs/forge-plugin-ts-paths
faltjs plugin to automatically resolve path aliases set in the compilerOptions section of tsconfig.json. Don't use it if you're already using rollup-plugin-typescript. This plugin is only for use cases where your TypeScript code has already been transpiled before rollup runs.
// tsconfig.json
{
"compilerOptions": {
// ...
"baseUrl": ".",
"paths": {
"@utils": ["src/helpers/utils"]
}
}
}
import { something } from '@utils';
Then this plugin will make sure that rollup knows how to resolve @utils.
Notes
typescript
is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import ts from 'typescript
;`