-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update sourcemapPathTransform to also take the path to the sourcemap … (
#3617) * Update sourcemapPathTransform to also take the path to the sourcemap file as a second argument * update docs * make test example make a little more sense * Fix test and types, polish documentation * Fix types again Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com> Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
- Loading branch information
1 parent
ef978c1
commit 37b876c
Showing
6 changed files
with
33 additions
and
10 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
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
17 changes: 17 additions & 0 deletions
17
test/sourcemaps/samples/transform-full-source-paths/_config.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,17 @@ | ||
const path = require('path'); | ||
const assert = require('assert'); | ||
|
||
module.exports = { | ||
description: 'provides the full source map path when transforming source maps', | ||
options: { | ||
output: { | ||
name: 'myModule', | ||
file: path.join(__dirname, '_actual/bundle.js'), | ||
sourcemapPathTransform: (relativeSourcePath, sourcemapPath) => | ||
path.resolve(path.dirname(sourcemapPath), relativeSourcePath) | ||
} | ||
}, | ||
test(code, map) { | ||
assert.deepEqual(map.sources, [path.resolve(__dirname, '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; |