tsconfig-paths-webpack-plugin icon indicating copy to clipboard operation
tsconfig-paths-webpack-plugin copied to clipboard

alias exclude rules supported

Open gogoyqj opened this issue 3 years ago • 1 comments

i'm using with bit, project structure is:

boilerplate
├── components/home/sfc-avatar
|  ├── SFCAvatar.tsx
|  └── node_modules/@components/IconFont
├── src/components/IconFont
└── tsconfig.json

tsconfig.json:

{
  "compilerOptions": {
    "baseUrl": "src",
    "paths": {
      "@components/*": ["./components/"]
    }
  }
}

webpack config:

    {
      resolve: {
        plugins: [new TsconfigPathsPlugin({})]
      }
    }

then if import SFCAvatar.tsx, components/home/sfc-avatar/node_modules/@components/IconFont is supposed to be resolved, but actually src/components/IconFont is resolved

can there is a exclude option supported just like(or i'd like to make a pr):

new TsconfigPathsPlugin({
  exclude: RegExp // test request.path
  exclude: (request) => boolean
})

gogoyqj avatar Sep 29 '20 10:09 gogoyqj