| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8dc3c89 commit cea0280
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -314,9 +314,20 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration { | |||
| 314 | 314 | if (scriptsSourceMap || stylesSourceMap) { | |
| 315 | 315 | extraRules.push({ | |
| 316 | 316 | test: /\.m?js$/, | |
| 317 | - exclude: vendorSourceMap ? undefined : /[\\\/]node_modules[\\\/]/, | ||
| 318 | 317 | enforce: 'pre', | |
| 319 | 318 | loader: require.resolve('source-map-loader'), | |
| 319 | + options: { | ||
| 320 | + filterSourceMappingUrl: (_mapUri: string, resourcePath: string) => { | ||
| 321 | + if (vendorSourceMap) { | ||
| 322 | + // Consume all sourcemaps when vendor option is enabled. | ||
| 323 | + return true; | ||
| 324 | + } | ||
| 325 | + | ||
| 326 | + // Don't consume sourcemaps in node_modules when vendor is disabled. | ||
| 327 | + // But, do consume local libraries sourcemaps. | ||
| 328 | + return !resourcePath.includes('node_modules'); | ||
| 329 | + }, | ||
| 330 | + }, | ||
| 320 | 331 | }); | |
| 321 | 332 | } | |
| 322 | 333 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments