Skip to content

Commit c356619

Browse files
authored
Merge pull request webpack#3384 from uncleyo/exclude-with-loader
Unhide own modules when loader path matches exclude filter
2 parents f4adee3 + 76e10f3 commit c356619

6 files changed

Lines changed: 31 additions & 1 deletion

File tree

lib/Stats.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Stats.prototype.toJson = function toJson(options, forToString) {
6464
}
6565
if(excludeModules.length === 0)
6666
return true;
67-
var ident = module.identifier();
67+
var ident = module.resource;
6868
return !excludeModules.some(function(regExp) {
6969
return regExp.test(ident);
7070
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = "a"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = "b"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Hash: affacd3db222d3fcb700
2+
Time: Xms
3+
Asset Size Chunks Chunk Names
4+
bundle.js 2.69 kB 0 [emitted] main
5+
chunk {0} bundle.js (main) 132 bytes [entry] [rendered]
6+
[0] (webpack)/test/statsCases/exclude-with-loader/a.txt 43 bytes {0} [built]
7+
[2] (webpack)/test/statsCases/exclude-with-loader/index.js 46 bytes {0} [built]
8+
+ 1 hidden modules
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require("./a.txt")
2+
require("./exclude/b.txt")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
entry: "./index",
3+
output: {
4+
filename: "bundle.js"
5+
},
6+
stats: {
7+
exclude: [
8+
"node_modules",
9+
"exclude"
10+
]
11+
},
12+
module: {
13+
loaders: [{
14+
test: /\.txt/,
15+
loader: "raw-loader"
16+
}]
17+
}
18+
};

0 commit comments

Comments
 (0)