Skip to content

Commit 5b96f00

Browse files
committed
add stats test for the warnings filter in the uglifyjsplugin
1 parent d24da75 commit 5b96f00

4 files changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.export = function someUsedFunction() {};
2+
3+
function someUnRemoteUsedFunction1() {}
4+
function someUnRemoteUsedFunction2() {}
5+
function someUnRemoteUsedFunction3() {}
6+
function someUnRemoteUsedFunction4() {}
7+
function someUnRemoteUsedFunction5() {}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Hash: 4beee256fa6b8f69eae8
2+
Time: Xms
3+
Asset Size Chunks Chunk Names
4+
bundle.js 2.3 kB 0 [emitted] main
5+
chunk {0} bundle.js (main) 1.04 kB [entry] [rendered]
6+
[0] (webpack)/buildin/module.js 495 bytes {0} [built]
7+
[1] (webpack)/test/statsCases/warnings-uglifyjs/a.js 249 bytes {0} [built]
8+
[2] (webpack)/test/statsCases/warnings-uglifyjs/index.js 299 bytes {0} [built]
9+
10+
WARNING in bundle.js from UglifyJs
11+
Dropping unused function someUnUsedFunction1 [./index.js:8,0]
12+
Dropping unused function someUnUsedFunction2 [./index.js:9,0]
13+
Dropping unused function someUnUsedFunction3 [./index.js:10,0]
14+
Dropping unused function someUnUsedFunction4 [./index.js:11,0]
15+
Dropping unused function someUnUsedFunction5 [./index.js:12,0]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var someRequiredUsedFunction = require("./a");
2+
3+
function someUsedFunction() {}
4+
5+
someRequiredUsedFunction();
6+
someUsedFunction();
7+
8+
function someUnUsedFunction1() {}
9+
function someUnUsedFunction2() {}
10+
function someUnUsedFunction3() {}
11+
function someUnUsedFunction4() {}
12+
function someUnUsedFunction5() {}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
var webpack = require("webpack");
2+
3+
module.exports = {
4+
entry: "./index",
5+
output: {
6+
filename: "bundle.js"
7+
},
8+
plugins: [new webpack.optimize.UglifyJsPlugin({
9+
warningsFilter: function(filename) {
10+
return !/a\.js$/.test(filename);
11+
},
12+
sourceMap: true,
13+
compress: {
14+
warnings: true,
15+
},
16+
mangle: false,
17+
beautify: true,
18+
comments: false
19+
})],
20+
stats: {
21+
chunkModules: false,
22+
modules: true,
23+
providedExports: true,
24+
usedExports: true
25+
}
26+
};

0 commit comments

Comments
 (0)