Skip to content

Commit bd4017b

Browse files
committed
shorter filenames in output
1 parent 31f9232 commit bd4017b

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

bin/webpack.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ if(!output) {
211211
cwdParent = new RegExp("^" + cwdParent + "|(!)" + cwdParent, "g");
212212
buildins = buildins.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
213213
buildins = new RegExp("^" + buildins + "|(!)" + buildins, "g");
214+
var node_modulesRegExpA = /\/node_modules\//g;
215+
var node_modulesRegExpB = /\\node_modules\\/g;
216+
var index_jsRegExp = /[\\\/]index.js!/g;
214217
function compressFilename(filename) {
215218
if(!filename)
216219
return filename;
@@ -219,8 +222,10 @@ if(!output) {
219222
filename = filename.replace(cwd, "!.");
220223
if(!buildinsAsModule)
221224
filename = filename.replace(buildins, "!(webpack)");
222-
filename = filename.replace(cwdParent, "!..");
223-
return filename.replace(/^!/, "");
225+
filename = filename.replace(node_modulesRegExpA, "/~/");
226+
filename = filename.replace(node_modulesRegExpB, "\\~\\");
227+
filename = filename.replace(index_jsRegExp, "!");
228+
return filename.replace(/^!|!$/, "");
224229
}
225230
if(stats.fileModules) {
226231
console.log();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack",
3-
"version": "0.3.11",
3+
"version": "0.3.12",
44
"author": "Tobias Koppers @sokra",
55
"description": "Packs CommonJs Modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loading of js, json, jade, coffee, css, ... out of the box and more with custom loaders.",
66
"dependencies": {

0 commit comments

Comments
 (0)