Skip to content

Commit 8975d8e

Browse files
authored
Merge branch 'master' into master
2 parents 859e0dd + d005990 commit 8975d8e

File tree

456 files changed

+11253
-7614
lines changed

Some content is hidden

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

456 files changed

+11253
-7614
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ language: node_js
44
branches:
55
only:
66
- master
7+
- next
78

89
cache:
910
directories:
@@ -13,10 +14,10 @@ cache:
1314
matrix:
1415
include:
1516
- os: linux
16-
node_js: "7"
17+
node_js: "8"
1718
env: NO_WATCH_TESTS=1 JOB_PART=lint
1819
- os: linux
19-
node_js: "7"
20+
node_js: "8"
2021
env: NO_WATCH_TESTS=1 JOB_PART=test
2122
- os: linux
2223
node_js: "6"
@@ -25,7 +26,7 @@ matrix:
2526
node_js: "4.3"
2627
env: NO_WATCH_TESTS=1 JOB_PART=test
2728
- os: osx
28-
node_js: "7"
29+
node_js: "8"
2930
env: NO_WATCH_TESTS=1 JOB_PART=test
3031
allow_failures:
3132
- os: osx

README.md

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ within webpack itself use this plugin interface. This makes webpack very
6969
|:--:|:----:|:----------|
7070
|[common-chunks-webpack-plugin][common]|![common-npm]|Generates chunks of common modules shared between entry points and splits them into separate bundles (e.g vendor.bundle.js && app.bundle.js)|
7171
|[extract-text-webpack-plugin][extract]|![extract-npm]|Extracts Text (CSS) from your bundles into a separate file (app.bundle.css)|
72-
|[component-webpack-plugin][component]|![component-npm]|Use components with webpack|
7372
|[compression-webpack-plugin][compression]|![compression-npm]|Prepare compressed versions of assets to serve them with Content-Encoding|
7473
|[i18n-webpack-plugin][i18n]|![i18n-npm]|Adds i18n support to your bundles|
7574
|[html-webpack-plugin][html-plugin]|![html-plugin-npm]| Simplifies creation of HTML files (`index.html`) to serve your bundles|
@@ -191,8 +190,6 @@ or are automatically applied via regex from your webpack configuration.
191190
|<a href="https://github.com/webpack/mocha-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/mocha.svg"></a>|![mocha-npm]|Tests with mocha (Browser/NodeJS)|
192191
|<a href="https://github.com/MoOx/eslint-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/eslint.svg"></a>|![eslint-npm]|PreLoader for linting code using ESLint|
193192
|<a href="https://github.com/webpack/jslint-loader"><img width="48" height="48" src="http://jshint.com/res/jshint-dark.png"></a>|![jshint-npm]|PreLoader for linting code using JSHint|
194-
|<a href="https://github.com/unindented/jscs-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/jscs.svg"></a>|![jscs-npm]|PreLoader for code style checking using JSCS|
195-
196193

197194
[mocha-npm]: https://img.shields.io/npm/v/mocha-loader.svg
198195
[eslint-npm]: https://img.shields.io/npm/v/eslint-loader.svg
@@ -241,20 +238,44 @@ friendly** by using hashes.
241238

242239
<h2 align="center">Contributing</h2>
243240

244-
Most of the time, if webpack is not working correctly for you it is a simple configuration issue.
241+
**We want contributing to webpack to be fun, enjoyable, and educational for anyone, and everyone.** We have a [vibrant ecosystem](https://medium.com/webpack/contributors-guide/home) that spans beyond this single repo. We welcome you to check out any of the repositories in [our organization](http://github.com/webpack) or [webpack-contrib organization](http://github.com/webpack-contrib) which houses all of our loaders and plugins.
242+
243+
Contributions go far beyond pull requests and commits. Although we love giving you the opportunity to put your stamp on webpack, we also are thrilled to receive a variety of other contributions including:
244+
245+
* [Documentation](https://github.com/webpack/webpack.js.org) updates, enhancements, designs, or bugfixes
246+
* Spelling or grammar fixes
247+
* README.md corrections or redesigns
248+
* Adding unit, or functional tests
249+
* Triaging GitHub issues -- especially determining whether an issue still persists or is reproducible.
250+
* [Searching #webpack on twitter](https://twitter.com/search?q=webpack) and helping someone else who needs help
251+
* Teaching others how to contribute to one of the many webpack repo's!
252+
* [Blogging, speaking about, or creating tutorials](https://github.com/webpack-contrib/awesome-webpack) about one of webpack's many features.
253+
* Helping others in our webpack [gitter channel](https://gitter.im/webpack/webpack).
254+
255+
If you are worried or don't know where to start, you can **always** reach out to [Sean Larkin (@TheLarkInn) on Twitter](https://twitter.com/thelarkinn) or simply submit an issue and a maintainer can help give you guidance!
256+
257+
We have also started a series on our [Medium Publication](https://medium.com/webpack) called [The Contributor's Guide to webpack](https://medium.com/webpack/contributors-guide/home). We welcome you to read it and post any questions or responses if you still need help.
258+
259+
_Looking to speak about webpack?_ We'd **love** to review your talk abstract/CFP! You can email it to webpack [at] opencollective [dot] com and we can give pointers or tips!!!
260+
261+
<h3 align="center">Creating your own plugins and loaders</h3>
262+
263+
If you create a loader or plugin, we would <3 for you to open source it, and put it on npm. We follow the `x-loader`, `x-webpack-plugin` naming convention.
264+
265+
<h2 align="center">Support</h2>
266+
267+
We consider webpack to be a low-level tool used not only individuals but also layered beneath other awesome tools. Because of it's flexibility, webpack isn't always the _easiest_ entry-level solution, however we do believe it is the most powerful. That said, we're always looking for ways improve and simplify the tool without compromising functionality. If you have any ideas on ways to accomplish this, we're all ears!
245268

246-
If you are still having difficulty after looking over your configuration carefully, please post
247-
a question to [StackOverflow with the webpack tag](https://stackoverflow.com/tags/webpack). Questions
248-
that include your webpack.config.js and relevant files are more likely to receive responses.
269+
If you're just getting started, take a look at [our new docs and concepts page](https://webpack.js.org/concepts/). This has a high level overview that is great for beginners!!
249270

250-
If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.
271+
If you want to discuss something or just need help, [here is our Gitter room](https://gitter.im/webpack/webpack) where there are always individuals looking to help out!
251272

252-
If you create a loader or plugin, please consider open sourcing it, putting it
253-
on npm and following the `x-loader`, `x-webpack-plugin` convention.
273+
If you are still having difficulty, we would love for you to post
274+
a question to [StackOverflow with the webpack tag](https://stackoverflow.com/tags/webpack). It is much easier to answer questions that include your webpack.config.js and relevant files! So if you can provide them, we'd be extremely grateful (and more likely to help you find the answer!)
254275

255-
You are also welcome to correct any spelling mistakes or any language issues.
276+
If you are twitter savvy you can tweet #webpack with your question and someone should be able to reach out and help also.
256277

257-
If you want to discuss something or just need help, [here is our Gitter room](https://gitter.im/webpack/webpack).
278+
If you have discovered a 🐜 or have a feature suggestion, feel free to create an issue on Github.
258279

259280
### License
260281

appveyor.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
branches:
55
only:
66
- master
7+
- next
78

89
init:
910
- git config --global core.autocrlf input
@@ -13,17 +14,17 @@ clone_depth: 50
1314
# what combinations to test
1415
environment:
1516
matrix:
16-
- nodejs_version: 7
17+
- nodejs_version: 8
1718
job_part: test
1819
- nodejs_version: 6
1920
job_part: test
2021

2122
install:
2223
- ps: Install-Product node $env:nodejs_version x64
2324
- npm install yarn -g
24-
- yarn install
25-
- yarn link
26-
- yarn link webpack
25+
- yarn install --frozen-lockfile
26+
- yarn link --frozen-lockfile || yarn link --frozen-lockfile
27+
- yarn link webpack --frozen-lockfile
2728

2829
build: off
2930

bin/convert-argv.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ var path = require("path");
22
var fs = require("fs");
33
fs.existsSync = fs.existsSync || path.existsSync;
44
var interpret = require("interpret");
5+
var prepareOptions = require("../lib/prepareOptions");
56

67
module.exports = function(yargs, argv, convertOptions) {
78

@@ -94,13 +95,7 @@ module.exports = function(yargs, argv, convertOptions) {
9495

9596
var requireConfig = function requireConfig(configPath) {
9697
var options = require(configPath);
97-
var isES6DefaultExportedFunc = (
98-
typeof options === "object" && options !== null && typeof options.default === "function"
99-
);
100-
if(typeof options === "function" || isES6DefaultExportedFunc) {
101-
options = isES6DefaultExportedFunc ? options.default : options;
102-
options = options(argv.env, argv);
103-
}
98+
options = prepareOptions(options, argv);
10499
return options;
105100
};
106101

bin/webpack.js

100755100644
Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,21 @@ yargs.options({
124124
group: DISPLAY_GROUP,
125125
describe: "Display information about exports provided from modules"
126126
},
127+
"display-optimization-bailout": {
128+
type: "boolean",
129+
group: DISPLAY_GROUP,
130+
describe: "Display information about why optimization bailed out for modules"
131+
},
127132
"display-error-details": {
128133
type: "boolean",
129134
group: DISPLAY_GROUP,
130135
describe: "Display details about errors"
131136
},
137+
"display": {
138+
type: "string",
139+
group: DISPLAY_GROUP,
140+
describe: "Select display preset (verbose, detailed, normal, minimal, errors-only, none)"
141+
},
132142
"verbose": {
133143
type: "boolean",
134144
group: DISPLAY_GROUP,
@@ -139,15 +149,7 @@ yargs.options({
139149
var argv = yargs.argv;
140150

141151
if(argv.verbose) {
142-
argv["display-reasons"] = true;
143-
argv["display-depth"] = true;
144-
argv["display-entrypoints"] = true;
145-
argv["display-used-exports"] = true;
146-
argv["display-provided-exports"] = true;
147-
argv["display-error-details"] = true;
148-
argv["display-modules"] = true;
149-
argv["display-cached"] = true;
150-
argv["display-cached-assets"] = true;
152+
argv["display"] = "verbose";
151153
}
152154

153155
var options = require("./convert-argv")(yargs, argv);
@@ -181,6 +183,11 @@ function processOptions(options) {
181183
} else if(!outputOptions) {
182184
outputOptions = {};
183185
}
186+
187+
ifArg("display", function(preset) {
188+
outputOptions = statsPresetToOptions(preset);
189+
});
190+
184191
outputOptions = Object.create(outputOptions);
185192
if(Array.isArray(options) && !outputOptions.children) {
186193
outputOptions.children = options.map(o => o.stats);
@@ -219,40 +226,55 @@ function processOptions(options) {
219226
outputOptions.cachedAssets = false;
220227

221228
ifArg("display-chunks", function(bool) {
222-
outputOptions.modules = !bool;
223-
outputOptions.chunks = bool;
229+
if(bool) {
230+
outputOptions.modules = false;
231+
outputOptions.chunks = true;
232+
outputOptions.chunkModules = true;
233+
}
224234
});
225235

226236
ifArg("display-entrypoints", function(bool) {
227-
outputOptions.entrypoints = bool;
237+
if(bool)
238+
outputOptions.entrypoints = true;
228239
});
229240

230241
ifArg("display-reasons", function(bool) {
231-
outputOptions.reasons = bool;
242+
if(bool)
243+
outputOptions.reasons = true;
232244
});
233245

234246
ifArg("display-depth", function(bool) {
235-
outputOptions.depth = bool;
247+
if(bool)
248+
outputOptions.depth = true;
236249
});
237250

238251
ifArg("display-used-exports", function(bool) {
239-
outputOptions.usedExports = bool;
252+
if(bool)
253+
outputOptions.usedExports = true;
240254
});
241255

242256
ifArg("display-provided-exports", function(bool) {
243-
outputOptions.providedExports = bool;
257+
if(bool)
258+
outputOptions.providedExports = true;
259+
});
260+
261+
ifArg("display-optimization-bailout", function(bool) {
262+
if(bool)
263+
outputOptions.optimizationBailout = bool;
244264
});
245265

246266
ifArg("display-error-details", function(bool) {
247-
outputOptions.errorDetails = bool;
267+
if(bool)
268+
outputOptions.errorDetails = true;
248269
});
249270

250271
ifArg("display-origins", function(bool) {
251-
outputOptions.chunkOrigins = bool;
272+
if(bool)
273+
outputOptions.chunkOrigins = true;
252274
});
253275

254276
ifArg("display-max-modules", function(value) {
255-
outputOptions.maxModules = value;
277+
outputOptions.maxModules = +value;
256278
});
257279

258280
ifArg("display-cached", function(bool) {
@@ -271,22 +293,8 @@ function processOptions(options) {
271293
if(argv["display-modules"]) {
272294
outputOptions.maxModules = Infinity;
273295
outputOptions.exclude = undefined;
274-
}
275-
} else {
276-
if(typeof outputOptions.chunks === "undefined")
277-
outputOptions.chunks = true;
278-
if(typeof outputOptions.entrypoints === "undefined")
279-
outputOptions.entrypoints = true;
280-
if(typeof outputOptions.modules === "undefined")
281296
outputOptions.modules = true;
282-
if(typeof outputOptions.chunkModules === "undefined")
283-
outputOptions.chunkModules = true;
284-
if(typeof outputOptions.reasons === "undefined")
285-
outputOptions.reasons = true;
286-
if(typeof outputOptions.cached === "undefined")
287-
outputOptions.cached = true;
288-
if(typeof outputOptions.cachedAssets === "undefined")
289-
outputOptions.cachedAssets = true;
297+
}
290298
}
291299

292300
ifArg("hide-modules", function(bool) {
@@ -337,7 +345,9 @@ function processOptions(options) {
337345
process.stdout.write(JSON.stringify(stats.toJson(outputOptions), null, 2) + "\n");
338346
} else if(stats.hash !== lastHash) {
339347
lastHash = stats.hash;
340-
process.stdout.write(stats.toString(outputOptions) + "\n");
348+
var statsString = stats.toString(outputOptions);
349+
if(statsString)
350+
process.stdout.write(statsString + "\n");
341351
}
342352
if(!options.watch && stats.hasErrors()) {
343353
process.on("exit", function() {

ci/travis-install.sh

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

4-
yarn link || true && yarn link webpack;
4+
yarn link --frozen-lockfile || true && yarn link webpack --frozen-lockfile;
5+
6+
yarn --frozen-lockfile
57

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ machine:
88

99
dependencies:
1010
pre:
11-
- case $CIRCLE_NODE_INDEX in 0) NODE_VERSION=4 ;; 1) NODE_VERSION=7 ;; esac; nvm install $NODE_VERSION && nvm alias default $NODE_VERSION
11+
- case $CIRCLE_NODE_INDEX in 0) NODE_VERSION=4 ;; 1) NODE_VERSION=8 ;; esac; nvm install $NODE_VERSION && nvm alias default $NODE_VERSION
1212
override:
1313
- yarn
1414
- yarn link || true && yarn link webpack

0 commit comments

Comments
 (0)