https://github.com/valentiniljaz/rollup-plugin-tsc-alias
Replace alias paths with relative paths after typescript compilation during rollup bundling
https://github.com/valentiniljaz/rollup-plugin-tsc-alias
Last synced: 5 months ago
JSON representation
Replace alias paths with relative paths after typescript compilation during rollup bundling
- Host: GitHub
- URL: https://github.com/valentiniljaz/rollup-plugin-tsc-alias
- Owner: valentiniljaz
- License: mit
- Created: 2022-03-25T08:02:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-06T20:23:41.000Z (over 3 years ago)
- Last Synced: 2024-11-09T10:32:20.953Z (about 1 year ago)
- Language: JavaScript
- Size: 28.3 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rollup plugin: tsc-alias
Replace alias paths with relative paths after typescript compilation during rollup bundling
## Installation
### npm
`npm install rollup-plugin-tsc-alias --save-dev`
### yarn
`yarn add rollup-plugin-tsc-alias --dev`
### Example
To run `tsc-alias` after TS built add the following to `rollup.config.js`:
```JavaScript
import tscAlias from 'rollup-plugin-tsc-alias';
export default {
entry: './src/index.ts',
output: {
dest: './dist/bundle.js',
},
plugins: [
tscAlias({
// OPTIONS
})
]
};
```
All the available options:
Option
Description
Default Value
configFile
path to tsconfig.json
'tsconfig.json'
watch
Observe file changes
false
outDir
Run in a folder leaving the "outDir" of the tsconfig.json (relative path to tsconfig)
tsconfig.compilerOptions.outDir
declarationDir
Works the same as outDir but for declarationDir
tsconfig.compilerOptions.declarationDir
resolveFullPaths
Attempt to replace incomplete import paths (those not ending in .js) with fully resolved paths (for ECMAScript Modules compatibility)
false
silent
Reduced terminal output. This is a deprecated option and no longer has any effect.
true
verbose
Additional information is output to the terminal
false
replacers
Files to import as extra replacers More info
[]
output
The output object tsc-alias will send logs to.
new Output(options.verbose)
## Author
This project is maintained by [Valentin Iljaž](https://github.com/valentiniljaz).
## License
MIT
## See also
If you find this Rollup plugin useful, you might also be interested in my other project, [Webacus](https://webacus.dev).
Webacus is the all-in-one toolkit designed to streamline the workflow of web developers. It solves the common problem of needing to quickly perform micro-tasks like encoding/decoding strings or formatting data by providing a unified platform with over 120 interconnected tools. Instead of searching for individual online tools, developers can access everything they need within Webacus, benefiting from a consistent interface and the ability to chain operations together for complex tasks. This local-first approach ensures speed, security, and privacy, allowing developers to focus on coding rather than managing tools.