Skip to content

Commit

Permalink
fix: Create word-based fidelity source mapping for code transformatio…
Browse files Browse the repository at this point in the history
…ns (#513)
  • Loading branch information
lforst committed Apr 2, 2024
1 parent 6fd1363 commit b87511c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/bundler-plugin-core/package.json
Expand Up @@ -58,7 +58,7 @@
"dotenv": "^16.3.1",
"find-up": "^5.0.0",
"glob": "^9.3.2",
"magic-string": "0.27.0",
"magic-string": "0.30.8",
"unplugin": "1.0.1"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/bundler-plugin-core/src/index.ts
Expand Up @@ -419,7 +419,7 @@ export function createRollupReleaseInjectionHooks(injectionCode: string) {

return {
code: ms.toString(),
map: ms.generateMap({ hires: true }),
map: ms.generateMap({ hires: "boundary" }),
};
},
};
Expand Down Expand Up @@ -464,7 +464,7 @@ export function createRollupDebugIdInjectionHooks() {

return {
code: ms.toString(),
map: ms.generateMap({ file: chunk.fileName, hires: true }),
map: ms.generateMap({ file: chunk.fileName, hires: "boundary" }),
};
} else {
return null; // returning null means not modifying the chunk at all
Expand Down Expand Up @@ -495,7 +495,7 @@ export function createRollupModuleMetadataInjectionHooks(injectionCode: string)

return {
code: ms.toString(),
map: ms.generateMap({ file: chunk.fileName, hires: true }),
map: ms.generateMap({ file: chunk.fileName, hires: "boundary" }),
};
} else {
return null; // returning null means not modifying the chunk at all
Expand Down
2 changes: 1 addition & 1 deletion packages/bundler-plugin-core/src/utils.ts
Expand Up @@ -326,7 +326,7 @@ export function replaceBooleanFlagsInCode(
if (ms.hasChanged()) {
return {
code: ms.toString(),
map: ms.generateMap({ hires: true }),
map: ms.generateMap({ hires: "boundary" }),
};
}

Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Expand Up @@ -2001,7 +2001,7 @@
resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24"
integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==

"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13", "@jridgewell/sourcemap-codec@^1.4.15":
"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.15":
version "1.4.15"
resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
Expand Down Expand Up @@ -9314,12 +9314,12 @@ lru_map@^0.3.3:
resolved "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd"
integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==

magic-string@0.27.0:
version "0.27.0"
resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz#e4a3413b4bab6d98d2becffd48b4a257effdbbf3"
integrity sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==
magic-string@0.30.8:
version "0.30.8"
resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz#14e8624246d2bedba70d5462aa99ac9681844613"
integrity sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.13"
"@jridgewell/sourcemap-codec" "^1.4.15"

magic-string@^0.25.7:
version "0.25.9"
Expand Down

0 comments on commit b87511c

Please sign in to comment.