@jsenv/sourcemap 1.4.3 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/magic_source.js +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/sourcemap",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@jridgewell/gen-mapping": "0.3.13",
|
|
17
17
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
18
18
|
"@jsenv/urls": "2.9.10",
|
|
19
|
-
"magic-string": "1.
|
|
19
|
+
"magic-string": "1.2.3",
|
|
20
20
|
"source-map-js": "1.2.1"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
package/src/magic_source.js
CHANGED
|
@@ -40,8 +40,14 @@ export const createMagicSource = (content) => {
|
|
|
40
40
|
content: code,
|
|
41
41
|
get sourcemap() {
|
|
42
42
|
if (map === undefined) {
|
|
43
|
+
// "boundary" = a mapping per word boundary. Per-character maps
|
|
44
|
+
// (hires: true) only add sub-word precision and cost ~25% of a
|
|
45
|
+
// package build in generation + composition + GC; line-level maps
|
|
46
|
+
// (hires: false) are cheaper still but collapse heavily rewritten
|
|
47
|
+
// lines (JSX) to their edit points. Word precision is what
|
|
48
|
+
// breakpoints, stack traces and devtools hovers actually consume.
|
|
43
49
|
map = magicString.generateMap({
|
|
44
|
-
hires:
|
|
50
|
+
hires: "boundary",
|
|
45
51
|
includeContent: true,
|
|
46
52
|
source,
|
|
47
53
|
});
|