Skip to content

Commit 3222e92

Browse files
committed
add comment explaining inline esbuild plugin
Signed-off-by: Karthik Ganeshram <[email protected]>
1 parent a4a8a8b commit 3222e92

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/build-tools/src/precompile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export function precompile(source, filename = '<input>', moduleMode = false, pre
6262

6363
const precompiledSource = magicString.toString() + `\n//# sourceMappingURL=${precompiledFileName}.map\n`;
6464

65-
// When we're ready to pipe in source maps:
6665
const map = magicString.generateMap({
6766
source: filename,
6867
file: `${precompiledFileName}.map`,

test/test-app/build.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import fs from 'fs';
66

77
const spinPlugin = await SpinEsbuildPlugin();
88

9+
// plugin to handle vendor files in node_modules that may not be bundled.
10+
// Instead of generating a real source map for these files, it appends a minimal
11+
// inline source map pointing to an empty source. This avoids errors and ensures
12+
// source maps exist even for unbundled vendor code.
913
let SourceMapPlugin = {
1014
name: 'excludeVendorFromSourceMap',
1115
setup(build) {

0 commit comments

Comments
 (0)