+17
-3
lines changedFilter options
+17
-3
lines changed Original file line number Diff line number Diff line change
@@ -116,7 +116,12 @@ function convertTypeScriptDiagnostic(
116
116
// This is a non-watch version of the compiler code from `@ngtools/webpack` augmented for esbuild
117
117
// eslint-disable-next-line max-lines-per-function
118
118
export function createCompilerPlugin(
119
-
pluginOptions: { sourcemap: boolean; tsconfig: string; advancedOptimizations?: boolean },
119
+
pluginOptions: {
120
+
sourcemap: boolean;
121
+
tsconfig: string;
122
+
advancedOptimizations?: boolean;
123
+
thirdPartySourcemaps?: boolean;
124
+
},
120
125
styleOptions: BundleStylesheetOptions,
121
126
): Plugin {
122
127
return {
@@ -318,10 +323,14 @@ export function createCompilerPlugin(
318
323
};
319
324
}
320
325
326
+
const useInputSourcemap =
327
+
pluginOptions.sourcemap &&
328
+
(!!pluginOptions.thirdPartySourcemaps || !/[\\/]node_modules[\\/]/.test(args.path));
329
+
321
330
const data = typescriptResult.content ?? '';
322
331
const babelResult = await transformAsync(data, {
323
332
filename: args.path,
324
-
inputSourceMap: (pluginOptions.sourcemap ? undefined : false) as undefined,
333
+
inputSourceMap: (useInputSourcemap ? undefined : false) as undefined,
325
334
sourceMaps: pluginOptions.sourcemap ? 'inline' : false,
326
335
compact: false,
327
336
configFile: false,
@@ -355,10 +364,14 @@ export function createCompilerPlugin(
355
364
)
356
365
).createEs2015LinkerPlugin;
357
366
367
+
const useInputSourcemap =
368
+
pluginOptions.sourcemap &&
369
+
(!!pluginOptions.thirdPartySourcemaps || !/[\\/]node_modules[\\/]/.test(args.path));
370
+
358
371
const data = await fs.readFile(args.path, 'utf-8');
359
372
const result = await transformAsync(data, {
360
373
filename: args.path,
361
-
inputSourceMap: (pluginOptions.sourcemap ? undefined : false) as undefined,
374
+
inputSourceMap: (useInputSourcemap ? undefined : false) as undefined,
362
375
sourceMaps: pluginOptions.sourcemap ? 'inline' : false,
363
376
compact: false,
364
377
configFile: false,
Original file line number Diff line number Diff line change
@@ -323,6 +323,7 @@ async function bundleCode(
323
323
// JS/TS options
324
324
{
325
325
sourcemap: !!sourcemapOptions.scripts,
326
+
thirdPartySourcemaps: sourcemapOptions.vendor,
326
327
tsconfig,
327
328
advancedOptimizations: options.buildOptimizer,
328
329
},
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4