Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5234 from webpack/bugfix/source-map-duplicate
Bugfix/source map duplicate
- Loading branch information
Showing
4 changed files
with
78 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function getSourceMap(filename) { | ||
var fs = require("fs"); | ||
var source = fs.readFileSync(__dirname + "/" + filename + ".map", "utf-8"); | ||
var map = JSON.parse(source); | ||
return map; | ||
} | ||
|
||
it("should include test.js in SourceMap", function() { | ||
var map = getSourceMap("bundle0.js"); | ||
map.sources.should.containEql("module"); | ||
map.sources.should.containEql("fallback"); | ||
map.sources.should.containEql("fallback**"); | ||
map = getSourceMap("chunk-a.js"); | ||
map.sources.should.containEql("fallback*"); | ||
map = getSourceMap("chunk-b.js"); | ||
map.sources.should.containEql("fallback*"); | ||
map.sources.should.containEql("fallback***"); | ||
}); | ||
|
||
require.ensure(["./test.js"], function(require) {}, "chunk-a"); | ||
require.ensure(["./test.js", "./test.js?1"], function(require) {}, "chunk-b"); |
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,3 @@ | ||
var foo = {}; | ||
|
||
module.exports = foo; |
12 changes: 12 additions & 0 deletions
12
test/configCases/source-map/module-names/webpack.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,12 @@ | ||
module.exports = { | ||
output: { | ||
chunkFilename: "[name].js", | ||
devtoolModuleFilenameTemplate: "module", | ||
devtoolFallbackModuleFilenameTemplate: "fallback" | ||
}, | ||
node: { | ||
__dirname: false, | ||
__filename: false | ||
}, | ||
devtool: "source-map" | ||
}; |