Skip to content

Commit

Permalink
don't shorten node_modules to ~
Browse files Browse the repository at this point in the history
it's confusing
  • Loading branch information
sokra committed Feb 1, 2017
1 parent 9e644ac commit dca8e62
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions lib/RequestShortener.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class RequestShortener {
this.buildinsRegExp = buildinsRegExp;
}

this.nodeModulesRegExp = /\/node_modules\//g;
this.indexJsRegExp = /\/index.js(!|\?|\(query\))/g;
}

Expand All @@ -49,7 +48,6 @@ class RequestShortener {
request = request.replace(this.parentDirectoryRegExp, "!..");
if(!this.buildinsAsModule && this.buildinsRegExp)
request = request.replace(this.buildinsRegExp, "!(webpack)");
request = request.replace(this.nodeModulesRegExp, "/~/");
request = request.replace(this.indexJsRegExp, "$1");
return request.replace(/^!|!$/, "");
}
Expand Down
2 changes: 1 addition & 1 deletion test/Compiler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe("Compiler", function() {
bundle.should.containEql("./main1.js");
bundle.should.containEql("./a.js");
bundle.should.containEql("./b.js");
bundle.should.containEql("./~/m1/a.js");
bundle.should.containEql("./node_modules/m1/a.js");
bundle.should.containEql("This is a");
bundle.should.containEql("This is b");
bundle.should.containEql("This is m1/a");
Expand Down
8 changes: 4 additions & 4 deletions test/statsCases/separate-css-bundle/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Child
[1] (webpack)/test/statsCases/separate-css-bundle/a/index.js 23 bytes {0} [built]
Child extract-text-webpack-plugin:
chunk {0} extract-text-webpack-plugin-output-filename 1.65 kB [entry] [rendered]
[0] (webpack)/~/css-loader!(webpack)/test/statsCases/separate-css-bundle/a/file.css 192 bytes {0} [built]
[1] (webpack)/~/css-loader/lib/css-base.js 1.46 kB {0} [built]
[0] (webpack)/node_modules/css-loader!(webpack)/test/statsCases/separate-css-bundle/a/file.css 192 bytes {0} [built]
[1] (webpack)/node_modules/css-loader/lib/css-base.js 1.46 kB {0} [built]
Child
Hash: f4d2d844a00ebd8ee85a
Time: Xms
Expand All @@ -23,5 +23,5 @@ Child
[1] (webpack)/test/statsCases/separate-css-bundle/b/index.js 23 bytes {0} [built]
Child extract-text-webpack-plugin:
chunk {0} extract-text-webpack-plugin-output-filename 1.65 kB [entry] [rendered]
[0] (webpack)/~/css-loader!(webpack)/test/statsCases/separate-css-bundle/b/file.css 194 bytes {0} [built]
[1] (webpack)/~/css-loader/lib/css-base.js 1.46 kB {0} [built]
[0] (webpack)/node_modules/css-loader!(webpack)/test/statsCases/separate-css-bundle/b/file.css 194 bytes {0} [built]
[1] (webpack)/node_modules/css-loader/lib/css-base.js 1.46 kB {0} [built]

0 comments on commit dca8e62

Please sign in to comment.