Gathering detailed insights and metrics for enhanced-tsconfig-paths-webpack-plugin
Gathering detailed insights and metrics for enhanced-tsconfig-paths-webpack-plugin
Gathering detailed insights and metrics for enhanced-tsconfig-paths-webpack-plugin
Gathering detailed insights and metrics for enhanced-tsconfig-paths-webpack-plugin
Load modules according to the closest tsconfig.json's paths in webpack, working greatly in Monorepo
npm install enhanced-tsconfig-paths-webpack-plugin
Typescript
Module System
Node Version
NPM Version
70.7
Supply Chain
94.9
Quality
75.5
Maintenance
100
Vulnerability
100
License
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
10 Stars
15 Commits
1 Forks
1 Watchers
2 Branches
2 Contributors
Updated on Jul 18, 2024
Latest Version
0.2.3
Package Id
enhanced-tsconfig-paths-webpack-plugin@0.2.3
Unpacked Size
50.32 kB
Size
9.82 kB
File Count
17
NPM Version
6.14.14
Node Version
14.17.4
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Load modules according to the closest tsconfig.json's paths in webpack, working greatly in Monorepo.
When resolving modules in webpack, it will use the closest tsconfig.json' paths of the file, for example:
1. 2├── apps 3│ ├── package.json 4│ ├── src 5│ │ ├── common 6│ │ │ └── index.ts 7│ │ └── index.ts 8│ ├── tsconfig.json // app's tsconfig.json, define its tsconfig.json's paths 9│ └── webpack.config.ts 10├── libs 11│ ├── package.json 12│ ├── src 13│ │ ├── index.ts 14│ │ └── utils 15│ │ └── index.ts 16│ └── tsconfig.json // lib's tsconfig.json, define its tsconfig.json's paths too 17├── package.json 18├── pnpm-lock.yaml 19├── pnpm-workspace.yaml 20└── README.md
In the example above, app import lib using @bright/shared
, when we start app using webpack, this plugin will load each file's closest tsconfig's paths(in apps it will load apps/tsconfig.json, in libs, it will load libs/tsconfig.json), and redirect it to the real path.
1# npm 2npm install -D enhanced-tsconfig-paths-webpack-plugin 3 4# or yarn 5yarn add -D enhanced-tsconfig-paths-webpack-plugin 6 7# or pnpm 8pnpm add -D enhanced-tsconfig-paths-webpack-plugin
1// webpack.config.ts 2import { join } from 'path'; 3import { Configuration } from 'webpack'; 4import { EnhancedTsconfigWebpackPlugin } from 'enhanced-tsconfig-paths-webpack-plugin'; 5 6export default { 7 entry: './src/index.ts', 8 output: { 9 path: join(__dirname, 'dist'), 10 filename: 'index.bundle.js' 11 }, 12 resolve: { 13 extensions: ['.ts', 'js'], 14 plugins: [ 15 // using EnhancedTsconfigWebpackPlugin 16 new EnhancedTsconfigWebpackPlugin() 17 ] 18 }, 19 mode: 'production', 20 module: { 21 rules: [ 22 { 23 test: /.+\.ts$/, 24 loader: 'ts-loader', 25 options: { 26 transpileOnly: true 27 } 28 } 29 ] 30 } 31} as Configuration;
Warning1: If you are using ts-loader to transpile typescript, please set
transpileOnly: true
to skip type-checking, or an type error may be throwed.Warning2: node_modules is ignored by default, the
ignoreNodeModules
option can configure this behavior
since 0.2.0
default: true
ignore mapping files under node_modules. Example:
1new EnhancedTsconfigWebpackPlugin({
2 ignoreNodeModules: false
3}),
since 0.2.0
default: { extensions: [...Object.key(require.extensions), '.tx', '.tsx'] matchAll: true mainFields: ['main'] }
options passed to tsconfig-paths.
1new EnhancedTsconfigWebpackPlugin({
2 tsconfigPaths: {
3 extensions: ['.ts'], // only map .ts file
4 mainFields: ['main'], // main package.json's main field
5 matchAll: true // add a extra * before matching, this is how typescript works
6 }
7})
1$ npm install -g pnpm@6.10.3 2$ pnpm start
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/12 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
43 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More