Browse Source

Fix #173 Update Webpack default sourcemap path override

* server/helpers/sourcemap.js: Resolve "webpack:///foo" as "${root}/foo".
* server/spec/helpers/sourcemap-spec.js: Update unit test.
run-to-here
Nicolas Petton 3 years ago
parent
commit
e9d5fe4c6c
No known key found for this signature in database GPG Key ID: E8BCD7866AFCF978
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      server/helpers/sourcemap.js
  2. +1
    -1
      server/spec/helpers/sourcemap-spec.js

+ 1
- 1
server/helpers/sourcemap.js View File

@ -10,7 +10,7 @@ const defaultSourceMapPathOverrides = {
"webpack:///./~/": "${root}/node_modules/",
"webpack:///src/": "${root}/",
"webpack:///./": "${root}/",
"webpack:///": "/"
"webpack:///": "${root}/"
};
const resolveSourceMap = async ({ url = "", sourceMapURL } = {}, conf) => {


+ 1
- 1
server/spec/helpers/sourcemap-spec.js View File

@ -52,7 +52,7 @@ describe("Applying source map path overrides", () => {
expect(applySourceMapPathOverrides("webpack:///./~/foo", conf))
.toEqual("/home/user/p/src/node_modules/foo");
expect(applySourceMapPathOverrides("webpack:///foo", conf))
.toEqual("/foo");
.toEqual("/home/user/p/src/foo");
});
});


Loading…
Cancel
Save