Skip to content

Commit

Permalink
Merge branch 'master' into webpack-2
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Oct 28, 2015
2 parents 20901c6 + e92bed7 commit 9dffb44
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/RecordIdsPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ module.exports = RecordIdsPlugin;
function makeRelative(compiler, identifier) {
var context = compiler.context;
return identifier.split("|").map(function(str) {
return path.relative(context, str);
return identifier.split("!").map(function(str) {
return path.relative(context, str);
}).join("!");
}).join("|");
}

Expand Down
1 change: 1 addition & 0 deletions lib/optimize/UglifyJsPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ UglifyJsPlugin.prototype.apply = function(compiler) {
warnings.push(warning);
};
}
uglify.base54.reset();
var ast = uglify.parse(input, {
filename: file
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"optimist": "~0.6.0",
"supports-color": "^3.1.0",
"tapable": "~0.1.8",
"uglify-js": "~2.4.24",
"uglify-js": "~2.5.0",
"watchpack": "^0.2.1",
"webpack-core": "~0.6.0"
},
Expand Down
1 change: 1 addition & 0 deletions test/configCases/records/issue-295/file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// just a file
3 changes: 3 additions & 0 deletions test/configCases/records/issue-295/loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = function(source) {
return source;
};
9 changes: 9 additions & 0 deletions test/configCases/records/issue-295/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require("./loader!./file");
require("./loader?2!./file");

it("should write relative paths to records", function() {
var fs = require("fs");
var path = require("path");
var content = fs.readFileSync(path.join(__dirname, "records.json"), "utf-8");
content.should.not.match(/webpack|issue/);
});
10 changes: 10 additions & 0 deletions test/configCases/records/issue-295/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var path = require("path");
var webpack = require("../../../../");
module.exports = {
entry: "./test",
recordsPath: path.resolve(__dirname, "../../../js/config/records/issue-295/records.json"),
target: "node",
node: {
__dirname: false
}
};

0 comments on commit 9dffb44

Please sign in to comment.