Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to transform the paths within a sourcemap. (#2430)
Resolves #2168.
- Loading branch information
1 parent
007f42b
commit b67bf5b
Showing
6 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const path = require('path'); | ||
const assert = require('assert'); | ||
|
||
module.exports = { | ||
description: 'transform sourcemap paths (#2168)', | ||
options: { | ||
output: { | ||
name: 'myModule', | ||
file: path.resolve(__dirname, '_actual/bundle.js'), | ||
sourcemapPathTransform: sourcePath => sourcePath.replace( | ||
`..${path.sep}`, | ||
'~/pkg-name/' | ||
) | ||
} | ||
}, | ||
test(code, map) { | ||
assert.deepEqual(map.sources, ['~/pkg-name/main.js']); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default 42; |