Skip to content
This repository was archived by the owner on Dec 6, 2022. It is now read-only.

Commit 98aae30

Browse files
committed
Clarify sourceMapPathOverrides docs, fix #626
1 parent dd0c948 commit 98aae30

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,16 @@ The debugger uses sourcemaps to let you debug with your original sources, but so
166166

167167
The left hand side of the mapping is a pattern that can contain a wildcard, and will be tested against the `sourceRoot` + `sources` entry in the source map. If it matches, the source file will be resolved to the path on the right hand side, which should be an absolute path to the source file on disk.
168168

169-
A few mappings are applied by default, corresponding to the default configs for Webpack and Meteor -
170-
```
169+
A few mappings are applied by default, corresponding to some common default configs for Webpack and Meteor:
170+
```json
171+
// Note: These are the mappings that are included by default out of the box, with examples of how they could be resolved in different scenarios. These are not mappings that would make sense together in one project.
172+
// webRoot = /Users/me/project
171173
"sourceMapPathOverrides": {
172174
"webpack:///./~/*": "${webRoot}/node_modules/*", // Example: "webpack:///./~/querystring/index.js" -> "/Users/me/project/node_modules/querystring/index.js"
173-
"webpack:///./*": "${webRoot}/*", // Example: "webpack:///./src/app.js" -> "/users/me/project/src/app.js",
174-
"webpack:///*": "*", // Example: "webpack:///C:/project/app.ts" -> "C:/project/app.ts"
175-
"webpack:///src/*": "${webRoot}/*", // Example: "webpack:///src/App.js" -> "C:/project/src/App.js"
176-
"meteor://💻app/*": "${webRoot}/*" // Example: "meteor://💻app/main.ts" -> "c:/code/main.ts"
175+
"webpack:///./*": "${webRoot}/*", // Example: "webpack:///./src/app.js" -> "/Users/me/project/src/app.js",
176+
"webpack:///*": "*", // Example: "webpack:///project/app.ts" -> "/project/app.ts"
177+
"webpack:///src/*": "${webRoot}/*", // Example: "webpack:///src/app.js" -> "/Users/me/project/app.js"
178+
"meteor://💻app/*": "${webRoot}/*" // Example: "meteor://💻app/main.ts" -> "/Users/me/project/main.ts"
177179
}
178180
```
179181
If you set `sourceMapPathOverrides` in your launch config, that will override these defaults. `${workspaceFolder}` and `${webRoot}` can be used here. If you aren't sure what the left side should be, you can use the `.scripts` command (details below). You can also use the `trace` option to see the contents of the sourcemap, or look at the paths of the sources in Chrome DevTools, or open your `.js.map` file and check the values manually.

0 commit comments

Comments
 (0)