Skip to content

Commit 9014901

Browse files
authored
Merge branch 'master' into bugfix/fix_stats_when_passed_array
2 parents ce49851 + 644e3a0 commit 9014901

199 files changed

Lines changed: 3689 additions & 2327 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.eslintrc‎

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,44 @@
44
"eslint:recommended"
55
],
66
"env": {
7-
"node": true
7+
"node": true,
8+
"es6": true
89
},
910
"rules": {
10-
"strict": 0,
11-
"camelcase": 0,
12-
"curly": 0,
13-
"indent": [2, "tab", { "SwitchCase": 1 }],
14-
"eol-last": 1,
15-
"no-shadow": 0,
16-
"no-redeclare": 2,
17-
"no-extra-bind": 1,
18-
"no-empty": 0,
19-
"no-process-exit": 1,
20-
"no-underscore-dangle": 0,
21-
"no-use-before-define": 0,
22-
"no-undef": 2,
23-
"no-unused-vars": 0,
24-
"consistent-return": 0,
25-
"no-inner-declarations": 1,
26-
"no-loop-func": 1,
27-
"space-before-function-paren": [2, "never"],
28-
"space-before-blocks": [2, "always"],
29-
"space-before-keywords": [2, "always"],
30-
"no-console": 0,
31-
"comma-dangle": 0,
32-
"no-unexpected-multiline": 2,
33-
"valid-jsdoc": 2
11+
"quotes": ["error", "double"],
12+
"no-undef": "error",
13+
"brace-style": "error",
14+
"eol-last": "error",
15+
"indent": ["error", "tab", { "SwitchCase": 1 }],
16+
"no-extra-bind": "warn",
17+
"no-empty": "off",
18+
"no-multiple-empty-lines": "error",
19+
"no-multi-spaces": "error",
20+
"no-process-exit": "warn",
21+
"space-in-parens": "error",
22+
"no-trailing-spaces": "error",
23+
"no-use-before-define": "off",
24+
"no-unused-vars": "off",
25+
"key-spacing": "error",
26+
"space-infix-ops": "error",
27+
"no-unsafe-negation": "error",
28+
"no-loop-func": "warn",
29+
"space-before-function-paren": ["error", "never"],
30+
"space-before-blocks": "error",
31+
"object-curly-spacing": ["error", "always"],
32+
"keyword-spacing": ["error", {
33+
"after": false,
34+
"overrides": {
35+
"try": {"after": true},
36+
"else": {"after": true},
37+
"throw": {"after": true},
38+
"case": {"after": true},
39+
"return": {"after": true},
40+
"finally": {"after": true},
41+
"do": {"after": true}
42+
}
43+
}],
44+
"no-console": "off",
45+
"valid-jsdoc": "error"
3446
}
3547
}

‎.travis.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ matrix:
2020
- os: linux
2121
node_js: "4"
2222
env: NO_WATCH_TESTS=1 JOB_PART=test
23-
- os: linux
24-
node_js: "v0.12.17"
25-
env: NO_WATCH_TESTS=1 JOB_PART=test
2623
- os: osx
2724
node_js: "7"
2825
env: NO_WATCH_TESTS=1 JOB_PART=test
@@ -33,7 +30,6 @@ matrix:
3330
node_js: "4"
3431
env: NO_WATCH_TESTS=1 JOB_PART=test
3532
allow_failures:
36-
- node_js: "v0.12.17"
3733
- os: osx
3834
fast_finish: true
3935

@@ -46,3 +42,7 @@ after_success:
4642
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose
4743
- cat ./coverage/coverage.json | node_modules/codecov.io/bin/codecov.io.js
4844
- rm -rf ./coverage
45+
46+
notifications:
47+
slack:
48+
secure: JduSdKWwbnLCwo7Z4E59SGE+Uw832UwnXzQiKEpg1BV45MYDPRiGltly1tRHmPh9OGjvGx3XSkC2tNGOBLtL4UL2SCkf012x0t7jDutKRfcv/njynl8jk8l+UhPmaWiHXDQAgGiiKdL4RfzPLW3HeVHCOWm0LKMzcarTa8tw+rE=

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ your pull request should be accepted quickly.
4848

4949
Some things that will increase the chance that your pull request is accepted:
5050

51-
* Write tests
51+
* [Write tests](./test/README.md)
5252
* Follow the existing coding style
5353
* Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
5454

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ within webpack itself use this plugin interface. This makes webpack very
8585
[i18n]: https://github.com/webpack/i18n-webpack-plugin
8686
[i18n-npm]: https://img.shields.io/npm/v/i18n-webpack-plugin.svg
8787
[html-plugin]: https://github.com/ampedandwired/html-webpack-plugin
88-
[html-plugin-npm]: https://img.shields.io/npm/v/component-webpack-plugin.svg
88+
[html-plugin-npm]: https://img.shields.io/npm/v/html-webpack-plugin.svg
8989

9090
### [Loaders](https://webpack.js.org/loaders/)
9191

‎bin/convert-argv.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function(yargs, argv, convertOptions) {
2424
var configFileLoaded = false;
2525
var configFiles = [];
2626
var extensions = Object.keys(interpret.extensions).sort(function(a, b) {
27-
return a === '.js' ? -1 : b === '.js' ? 1 : a.length - b.length;
27+
return a === ".js" ? -1 : b === ".js" ? 1 : a.length - b.length;
2828
});
2929
var defaultConfigFiles = ["webpack.config", "webpackfile"].map(function(filename) {
3030
return extensions.map(function(ext) {

‎bin/webpack.js‎

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ yargs.options({
7373
group: DISPLAY_GROUP,
7474
describe: "Display even excluded modules in the output"
7575
},
76+
"display-max-modules": {
77+
type: "number",
78+
group: DISPLAY_GROUP,
79+
describe: "Sets the maximum number of visible modules in output"
80+
},
7681
"display-chunks": {
7782
type: "boolean",
7883
group: DISPLAY_GROUP,
@@ -103,6 +108,11 @@ yargs.options({
103108
group: DISPLAY_GROUP,
104109
describe: "Display reasons about module inclusion in the output"
105110
},
111+
"display-depth": {
112+
type: "boolean",
113+
group: DISPLAY_GROUP,
114+
describe: "Display distance from entry point for each module"
115+
},
106116
"display-used-exports": {
107117
type: "boolean",
108118
group: DISPLAY_GROUP,
@@ -129,6 +139,7 @@ var argv = yargs.argv;
129139

130140
if(argv.verbose) {
131141
argv["display-reasons"] = true;
142+
argv["display-depth"] = true;
132143
argv["display-entrypoints"] = true;
133144
argv["display-used-exports"] = true;
134145
argv["display-provided-exports"] = true;
@@ -229,6 +240,10 @@ function processOptions(options) {
229240
outputOptions.reasons = bool;
230241
});
231242

243+
ifArg("display-depth", function(bool) {
244+
outputOptions.depth = bool;
245+
});
246+
232247
ifArg("display-used-exports", function(bool) {
233248
outputOptions.usedExports = bool;
234249
});
@@ -245,6 +260,10 @@ function processOptions(options) {
245260
outputOptions.chunkOrigins = bool;
246261
});
247262

263+
ifArg("display-max-modules", function(value) {
264+
outputOptions.maxModules = value;
265+
});
266+
248267
ifArg("display-cached", function(bool) {
249268
if(bool)
250269
outputOptions.cached = true;
@@ -255,8 +274,13 @@ function processOptions(options) {
255274
outputOptions.cachedAssets = true;
256275
});
257276

258-
if(!outputOptions.exclude && !argv["display-modules"])
277+
if(!outputOptions.exclude)
259278
outputOptions.exclude = ["node_modules", "bower_components", "jam", "components"];
279+
280+
if(argv["display-modules"]) {
281+
outputOptions.maxModules = Infinity;
282+
outputOptions.exclude = undefined;
283+
}
260284
} else {
261285
if(typeof outputOptions.chunks === "undefined")
262286
outputOptions.chunks = true;
@@ -335,13 +359,13 @@ function processOptions(options) {
335359
var primaryOptions = !Array.isArray(options) ? options : options[0];
336360
var watchOptions = primaryOptions.watchOptions || primaryOptions.watch || {};
337361
if(watchOptions.stdin) {
338-
process.stdin.on('end', function() {
362+
process.stdin.on("end", function() {
339363
process.exit(0); // eslint-disable-line
340364
});
341365
process.stdin.resume();
342366
}
343367
compiler.watch(watchOptions, compilerCallback);
344-
console.log('\nWebpack is watching the files…\n');
368+
console.log("\nWebpack is watching the files…\n");
345369
} else
346370
compiler.run(compilerCallback);
347371

‎ci/travis-install.sh‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/bin/bash
22
set -ev
33

4-
if [ "$TRAVIS_NODE_VERSION" == "v0.12.17" ]; then
5-
npm install --force && npm link && npm link webpack;
6-
else
7-
npm install yarn -g && yarn install && yarn link || true && yarn link webpack;
8-
fi
4+
npm install yarn -g && yarn install && yarn link || true && yarn link webpack;
5+

‎examples/agressive-merging/README.md‎

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,21 @@ module.exports = {
5656
## Uncompressed
5757

5858
```
59-
Hash: 06a73dcf91032a0ba5a5
60-
Version: webpack 2.1.0-beta.25
61-
Time: 147ms
59+
Hash: 06f18f1663d1b6555aff
60+
Version: webpack 2.2.0-rc.2
6261
Asset Size Chunks Chunk Names
63-
0.chunk.js 5.75 kB 0 [emitted]
62+
0.chunk.js 5.76 kB 0 [emitted]
6463
1.chunk.js 397 bytes 1 [emitted]
65-
pageB.bundle.js 5.98 kB 2 [emitted] pageB
66-
pageA.bundle.js 5.95 kB 3 [emitted] pageA
67-
pageC.bundle.js 5.75 kB 4 [emitted] pageC
64+
pageB.bundle.js 6.17 kB 2 [emitted] pageB
65+
pageA.bundle.js 6.14 kB 3 [emitted] pageA
66+
pageC.bundle.js 5.94 kB 4 [emitted] pageC
6867
Entrypoint pageA = pageA.bundle.js
6968
Entrypoint pageB = pageB.bundle.js
7069
Entrypoint pageC = pageC.bundle.js
71-
chunk {0} 0.chunk.js 5.54 kB {3} {2} [rendered]
70+
chunk {0} 0.chunk.js 5.55 kB {2} {3} [rendered]
7271
> aggressive-merge [3] ./pageA.js 1:0-3:2
7372
> aggressive-merge [4] ./pageB.js 1:0-3:2
74-
[2] ./common.js 5.54 kB {0} [built]
73+
[2] ./common.js 5.55 kB {0} [built]
7574
amd require ./common [3] ./pageA.js 1:0-3:2
7675
amd require ./common [4] ./pageB.js 1:0-3:2
7776
chunk {1} 1.chunk.js 42 bytes {4} [rendered]
@@ -82,42 +81,41 @@ chunk {1} 1.chunk.js 42 bytes {4} [rendered]
8281
[1] ./b.js 21 bytes {1} {2} [built]
8382
cjs require ./b [4] ./pageB.js 2:8-22
8483
cjs require ./b [5] ./pageC.js 2:17-31
85-
chunk {2} pageB.bundle.js (pageB) 90 bytes [entry] [rendered]
84+
chunk {2} pageB.bundle.js (pageB) 92 bytes [entry] [rendered]
8685
> pageB [4] ./pageB.js
8786
[1] ./b.js 21 bytes {1} {2} [built]
8887
cjs require ./b [4] ./pageB.js 2:8-22
8988
cjs require ./b [5] ./pageC.js 2:17-31
90-
[4] ./pageB.js 69 bytes {2} [built]
91-
chunk {3} pageA.bundle.js (pageA) 90 bytes [entry] [rendered]
89+
[4] ./pageB.js 71 bytes {2} [built]
90+
chunk {3} pageA.bundle.js (pageA) 92 bytes [entry] [rendered]
9291
> pageA [3] ./pageA.js
9392
[0] ./a.js 21 bytes {1} {3} [built]
9493
cjs require ./a [3] ./pageA.js 2:8-22
9594
amd require ./a [5] ./pageC.js 1:0-3:2
96-
[3] ./pageA.js 69 bytes {3} [built]
97-
chunk {4} pageC.bundle.js (pageC) 68 bytes [entry] [rendered]
95+
[3] ./pageA.js 71 bytes {3} [built]
96+
chunk {4} pageC.bundle.js (pageC) 70 bytes [entry] [rendered]
9897
> pageC [5] ./pageC.js
99-
[5] ./pageC.js 68 bytes {4} [built]
98+
[5] ./pageC.js 70 bytes {4} [built]
10099
```
101100

102101
## Minimized (uglify-js, no zip)
103102

104103
```
105-
Hash: 06a73dcf91032a0ba5a5
106-
Version: webpack 2.1.0-beta.25
107-
Time: 417ms
104+
Hash: 06f18f1663d1b6555aff
105+
Version: webpack 2.2.0-rc.2
108106
Asset Size Chunks Chunk Names
109107
0.chunk.js 75 bytes 0 [emitted]
110108
1.chunk.js 78 bytes 1 [emitted]
111-
pageB.bundle.js 1.45 kB 2 [emitted] pageB
112-
pageA.bundle.js 1.45 kB 3 [emitted] pageA
113-
pageC.bundle.js 1.43 kB 4 [emitted] pageC
109+
pageB.bundle.js 1.48 kB 2 [emitted] pageB
110+
pageA.bundle.js 1.48 kB 3 [emitted] pageA
111+
pageC.bundle.js 1.46 kB 4 [emitted] pageC
114112
Entrypoint pageA = pageA.bundle.js
115113
Entrypoint pageB = pageB.bundle.js
116114
Entrypoint pageC = pageC.bundle.js
117-
chunk {0} 0.chunk.js 5.54 kB {3} {2} [rendered]
115+
chunk {0} 0.chunk.js 5.55 kB {2} {3} [rendered]
118116
> aggressive-merge [3] ./pageA.js 1:0-3:2
119117
> aggressive-merge [4] ./pageB.js 1:0-3:2
120-
[2] ./common.js 5.54 kB {0} [built]
118+
[2] ./common.js 5.55 kB {0} [built]
121119
amd require ./common [3] ./pageA.js 1:0-3:2
122120
amd require ./common [4] ./pageB.js 1:0-3:2
123121
chunk {1} 1.chunk.js 42 bytes {4} [rendered]
@@ -128,19 +126,19 @@ chunk {1} 1.chunk.js 42 bytes {4} [rendered]
128126
[1] ./b.js 21 bytes {1} {2} [built]
129127
cjs require ./b [4] ./pageB.js 2:8-22
130128
cjs require ./b [5] ./pageC.js 2:17-31
131-
chunk {2} pageB.bundle.js (pageB) 90 bytes [entry] [rendered]
129+
chunk {2} pageB.bundle.js (pageB) 92 bytes [entry] [rendered]
132130
> pageB [4] ./pageB.js
133131
[1] ./b.js 21 bytes {1} {2} [built]
134132
cjs require ./b [4] ./pageB.js 2:8-22
135133
cjs require ./b [5] ./pageC.js 2:17-31
136-
[4] ./pageB.js 69 bytes {2} [built]
137-
chunk {3} pageA.bundle.js (pageA) 90 bytes [entry] [rendered]
134+
[4] ./pageB.js 71 bytes {2} [built]
135+
chunk {3} pageA.bundle.js (pageA) 92 bytes [entry] [rendered]
138136
> pageA [3] ./pageA.js
139137
[0] ./a.js 21 bytes {1} {3} [built]
140138
cjs require ./a [3] ./pageA.js 2:8-22
141139
amd require ./a [5] ./pageC.js 1:0-3:2
142-
[3] ./pageA.js 69 bytes {3} [built]
143-
chunk {4} pageC.bundle.js (pageC) 68 bytes [entry] [rendered]
140+
[3] ./pageA.js 71 bytes {3} [built]
141+
chunk {4} pageC.bundle.js (pageC) 70 bytes [entry] [rendered]
144142
> pageC [5] ./pageC.js
145-
[5] ./pageC.js 68 bytes {4} [built]
143+
[5] ./pageC.js 70 bytes {4} [built]
146144
```

0 commit comments

Comments
 (0)