Comparing version 0.4.15 to 0.4.16
@@ -159,2 +159,3 @@ #!/usr/bin/env node | ||
if(!options.outputPostfix) options.outputPostfix = "." + path.basename(output); | ||
if(!options.context) options.context = process.cwd(); | ||
@@ -217,3 +218,4 @@ // some listeners for the progress display | ||
"by-size": argv["by-size"], | ||
verbose: argv.verbose | ||
verbose: argv.verbose, | ||
context: options.context | ||
})); | ||
@@ -220,0 +222,0 @@ } |
@@ -0,2 +1,7 @@ | ||
/* | ||
MIT License http://www.opensource.org/licenses/mit-license.php | ||
Author Tobias Koppers @sokra | ||
*/ | ||
var sprintf = require("sprintf").sprintf; | ||
var createFilenameShortener = require("./createFilenameShortener"); | ||
var path = require("path"); | ||
@@ -21,28 +26,3 @@ module.exports = function(stats, options) { | ||
}); | ||
var cwd = process.cwd(); | ||
var cwdParent = path.dirname(cwd); | ||
var buildins = path.join(__dirname, ".."); | ||
cwd = cwd.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); | ||
cwd = new RegExp("^" + cwd + "|(!)" + cwd, "g"); | ||
var buildinsAsModule = cwd.test(buildins); | ||
cwdParent = cwdParent.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); | ||
cwdParent = new RegExp("^" + cwdParent + "|(!)" + cwdParent, "g"); | ||
buildins = buildins.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); | ||
buildins = new RegExp("^" + buildins + "|(!)" + buildins, "g"); | ||
var node_modulesRegExpA = /\/node_modules\//g; | ||
var node_modulesRegExpB = /\\node_modules\\/g; | ||
var index_jsRegExp = /[\\\/]index.js!/g; | ||
function compressFilename(filename) { | ||
if(!filename) | ||
return filename; | ||
if(buildinsAsModule) | ||
filename = filename.replace(buildins, "!(webpack)"); | ||
filename = filename.replace(cwd, "!."); | ||
if(!buildinsAsModule) | ||
filename = filename.replace(buildins, "!(webpack)"); | ||
filename = filename.replace(node_modulesRegExpA, "/~/"); | ||
filename = filename.replace(node_modulesRegExpB, "\\~\\"); | ||
filename = filename.replace(index_jsRegExp, "!"); | ||
return filename.replace(/^!|!$/, ""); | ||
} | ||
var compressFilename = options.context ? createFilenameShortener(options.context) : function(f) { return f }; | ||
if(stats.fileModules) { | ||
@@ -49,0 +29,0 @@ buf.push(""); |
@@ -84,2 +84,4 @@ /* | ||
options.context = options.context || context; | ||
if(options.output) { | ||
@@ -86,0 +88,0 @@ if(!options.outputDirectory) { |
@@ -208,2 +208,3 @@ /* | ||
// create a cool eval for debug mode | ||
var shortenFilename = require("./createFilenameShortener")(options.context); | ||
result = [ | ||
@@ -217,3 +218,3 @@ "eval(", | ||
"// module.chunks = ", module.chunks.join(", "), "\n", | ||
"//@ sourceURL=webpack-module:///", encodeURI(module.filename || module.dirname).replace(/%5C|%2F/g, "/").replace(/^\//, "") | ||
"//@ sourceURL=webpack-module:///", encodeURI(shortenFilename(module.filename || module.dirname)).replace(/%5C|%2F/g, "/").replace(/^\//, "") | ||
].join("")), | ||
@@ -220,0 +221,0 @@ ");"].join(""); |
{ | ||
"name": "webpack", | ||
"version": "0.4.15", | ||
"version": "0.4.16", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "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.", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
309774
132
8611