mirror of https://github.com/webpack/webpack.git
Merge pull request #3384 from uncleyo/exclude-with-loader
Unhide own modules when loader path matches exclude filter
This commit is contained in:
commit
c356619bbe
|
|
@ -64,7 +64,7 @@ Stats.prototype.toJson = function toJson(options, forToString) {
|
|||
}
|
||||
if(excludeModules.length === 0)
|
||||
return true;
|
||||
var ident = module.identifier();
|
||||
var ident = module.resource;
|
||||
return !excludeModules.some(function(regExp) {
|
||||
return regExp.test(ident);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
module.exports = "a"
|
||||
|
|
@ -0,0 +1 @@
|
|||
module.exports = "b"
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
Hash: affacd3db222d3fcb700
|
||||
Time: Xms
|
||||
Asset Size Chunks Chunk Names
|
||||
bundle.js 2.69 kB 0 [emitted] main
|
||||
chunk {0} bundle.js (main) 132 bytes [entry] [rendered]
|
||||
[0] (webpack)/test/statsCases/exclude-with-loader/a.txt 43 bytes {0} [built]
|
||||
[2] (webpack)/test/statsCases/exclude-with-loader/index.js 46 bytes {0} [built]
|
||||
+ 1 hidden modules
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
require("./a.txt")
|
||||
require("./exclude/b.txt")
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
module.exports = {
|
||||
entry: "./index",
|
||||
output: {
|
||||
filename: "bundle.js"
|
||||
},
|
||||
stats: {
|
||||
exclude: [
|
||||
"node_modules",
|
||||
"exclude"
|
||||
]
|
||||
},
|
||||
module: {
|
||||
loaders: [{
|
||||
test: /\.txt/,
|
||||
loader: "raw-loader"
|
||||
}]
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue