Skip to content

Commit

Permalink
Merge pull request #6788 from byzyk/fix/6779
Browse files Browse the repository at this point in the history
fix: Chunks is not iterable when using source maps with ProfilingPlugin
  • Loading branch information
sokra committed Mar 20, 2018
2 parents c6b9b9e + d061aba commit 3024078
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/debug/ProfilingPlugin.js
Expand Up @@ -305,16 +305,16 @@ const interceptAllParserHooks = (moduleFactory, tracer) => {
};

const makeInterceptorFor = (instance, tracer) => hookName => ({
register: ({ name, type, fn }) => {
register: ({ name, type, context, fn }) => {
const newFn = makeNewProfiledTapFn(hookName, tracer, {
name,
type,
fn
});
return {
// eslint-disable-line
name,
type,
context,
fn: newFn
};
}
Expand Down
@@ -0,0 +1,8 @@
it("bundle0 should include sourcemapped test.js", function() {
var fs = require("fs");
var source = fs.readFileSync(__filename + ".map", "utf-8");
var map = JSON.parse(source);
map.sources.should.containEql("webpack:///./test.js");
});

require.include("./test.js");
@@ -0,0 +1,3 @@
var foo = {};

module.exports = foo;
@@ -0,0 +1,22 @@
var webpack = require("../../../../");
var path = require("path");
var os = require("os");

module.exports = {
node: {
__dirname: false,
__filename: false
},
entry: {
bundle0: ["./index.js"]
},
output: {
filename: "[name].js"
},
plugins: [
new webpack.debug.ProfilingPlugin({
outputPath: path.join(os.tmpdir(), "events.json")
})
],
devtool: "source-map"
};

0 comments on commit 3024078

Please sign in to comment.