Skip to content

wjfei/esbuild-plugin-tsconfig-paths

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esbuild-plugin-tsconfig-paths

Transform compilerOptions.paths alias to relative path;

For example:

before transformed

// src/app/index.ts
import util from "@/utils/util"

after transformed

import util from "../utils/util"

Install

npm install esbuild-plugin-tsconfig-paths --dev

Usage

import { tsconfigPathsPlugin } from "esbuild-plugin-tsconfig-paths";
import esbuild from "esbuild";

esbuild.build({
    // ...other config
    plugins: [
        // ... other plugins
        tsconfigPathsPlugin({
            // Directory of tsconfig file
            cwd: process.cwd(),
            // tsconfig filename
            tsconfig: "custom-tsconfig.json",
            // which files will be transformed
            filter: /.*/,
        })
    ]
})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published