Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 535 Bytes

README.md

File metadata and controls

31 lines (26 loc) · 535 Bytes

esbuild-ts-paths

Transform TS path alias to absolute paths for esbuild

Example

// tsconfig.json

"compilerOptions": {
  "outDir": "./dist",
    "baseUrl": ".",
    "paths": {
    "@common/*": ["../common/*"], // asterisks are important
    "@shared/*": ["./src/shared/*"]
  }
}
// esbuild
const tsPaths = require("esbuild-ts-paths") 
esbuild.build({
    //...
    plugins:[
        tsPaths(
            "./path/to/tsconfig.json" // optional, defaults to ./tsconfig.json
        )
    ]
})