diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
commit | 0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch) | |
tree | f9864d4a4148621378958794cbbfdc2393733283 /node_modules/webpack/lib/SourceMapDevToolPlugin.js | |
parent | 6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff) |
upgrade dependencies
Diffstat (limited to 'node_modules/webpack/lib/SourceMapDevToolPlugin.js')
-rw-r--r-- | node_modules/webpack/lib/SourceMapDevToolPlugin.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/node_modules/webpack/lib/SourceMapDevToolPlugin.js b/node_modules/webpack/lib/SourceMapDevToolPlugin.js index 7892cb8ac..e63f34afb 100644 --- a/node_modules/webpack/lib/SourceMapDevToolPlugin.js +++ b/node_modules/webpack/lib/SourceMapDevToolPlugin.js @@ -158,7 +158,7 @@ class SourceMapDevToolPlugin { const moduleFilenames = modules.map(m => moduleToSourceNameMapping.get(m));
sourceMap.sources = moduleFilenames;
if(sourceMap.sourcesContent && !options.noSources) {
- sourceMap.sourcesContent = sourceMap.sourcesContent.map((content, i) => `${content}\n\n\n${ModuleFilenameHelpers.createFooter(modules[i], requestShortener)}`);
+ sourceMap.sourcesContent = sourceMap.sourcesContent.map((content, i) => typeof content === "string" ? `${content}\n\n\n${ModuleFilenameHelpers.createFooter(modules[i], requestShortener)}` : null);
} else {
sourceMap.sourcesContent = undefined;
}
@@ -181,14 +181,14 @@ class SourceMapDevToolPlugin { }
let sourceMapFile = compilation.getPath(sourceMapFilename, {
chunk,
- filename,
+ filename: options.fileContext ? path.relative(options.fileContext, filename) : filename,
query,
basename: basename(filename)
});
if(sourceMapFile.indexOf("[contenthash]") !== -1) {
sourceMapFile = sourceMapFile.replace(/\[contenthash\]/g, crypto.createHash("md5").update(sourceMapString).digest("hex"));
}
- const sourceMapUrl = path.relative(path.dirname(file), sourceMapFile).replace(/\\/g, "/");
+ const sourceMapUrl = options.publicPath ? options.publicPath + sourceMapFile.replace(/\\/g, "/") : path.relative(path.dirname(file), sourceMapFile).replace(/\\/g, "/");
if(currentSourceMappingURLComment !== false) {
asset.__SourceMapDevToolData[file] = compilation.assets[file] = new ConcatSource(new RawSource(source), currentSourceMappingURLComment.replace(/\[url\]/g, sourceMapUrl));
}
|