Skip to content

Commit 50bb27e

Browse files
committed
Merge branch 'master' of https://github.com/webpack/webpack.js.org into update-support
2 parents a586f28 + 33b6b4d commit 50bb27e

File tree

13 files changed

+748
-935
lines changed

13 files changed

+748
-935
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ node_js:
88
script:
99
- bash ./scripts/deploy.sh
1010
sudo: required
11-
cache: yarn
1211
install:
1312
- npm i yarn -g
1413
- yarn

components/organization/projects.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
"repo": "webpack/i18n-webpack-plugin",
257257
"npm": "i18n-webpack-plugin",
258258
"description": "Embed localization into your bundle.",
259-
"maintainer": "EcutDavid"
259+
"maintainer": ""
260260
},
261261
{
262262
"repo": "webpack/json5-loader",

content/api/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ These options allow you to bind [modules](/configuration/module/) as allowed by
176176

177177
| Parameter | Explanation | Usage |
178178
|--------------------|------------------------------------|-----------------------------|
179-
| --module-bind | Bind an extension to a loader | --module-bind /\.js$/=babel |
179+
| --module-bind | Bind an extension to a loader | --module-bind /\.js$/=babel-loader |
180180
| --module-bind-post | Bind an extension to a post loader | |
181181
| --module-bind-pre | Bind an extension to a pre loader | |
182182

content/concepts/loaders.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ T> Use `module.rules` whenever possible, as this will reduce boilerplate in your
100100
Optionally, you could also use loaders through the CLI:
101101

102102
```sh
103-
webpack --module-bind jade --module-bind 'css=style!css'
103+
webpack --module-bind jade-loader --module-bind 'css=style-loader!css-loader'
104104
```
105105

106106
This uses the `jade-loader` for `.jade` files, and the [`style-loader`](/loaders/style-loader) and [`css-loader`](/loaders/css-loader) for `.css` files.

content/configuration/devtool.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Choose a style of [source mapping](http://blog.teamtreehouse.com/introduction-so
2626
source-map | -- | -- | yes | original source
2727
nosources-source-map | -- | -- | yes | without source content
2828

29+
T> `+` means faster, `-` slower and `o` about the same time
30+
2931
Some of these values are suited for development and some for production. For development you typically want fast Source Maps at the cost of bundle size, but for production you want separate Source Maps that are accurate.
3032

3133
W> There are some issues with Source Maps in Chrome. [We need your help!](https://github.com/webpack/webpack/issues/3165).

content/guides/code-splitting-css.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ webpack can help with this problem by bundling the CSS separately using the `Ext
4444

4545
Install the [`ExtractTextWebpackPlugin`](/plugins/extract-text-webpack-plugin) plugin as follows
4646
```
47-
npm i --save-dev extract-text-webpack-plugin@beta
47+
npm i --save-dev extract-text-webpack-plugin
4848
```
4949

50-
To use this plugin, it needs to be added to the `webpack.config.js` file in two steps.
50+
To use this plugin, it needs to be added to the `webpack.config.js` file in three steps.
5151

5252
```diff
53+
+var ExtractTextPlugin = require('extract-text-webpack-plugin');
5354
module.exports = {
5455
module: {
5556
rules: [{

content/guides/comparison.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ webpack is not the only module bundler out there. If you are choosing between us
1313
| Feature | webpack/webpack | jrburke/requirejs | substack/node-browserify | jspm/jspm-cli | rollup/rollup | brunch/brunch |
1414
|---------|-----------------|-------------------|--------------------------|---------------|---------------|---------------|
1515
| Additional chunks are loaded on demand | **yes** | **yes** | no | [System.import](https://github.com/systemjs/systemjs/blob/master/docs/system-api.md#systemimportmodulename--normalizedparentname---promisemodule) | no | no |
16-
| AMD `define` | **yes** | **yes** | [deamdify](https://github.com/jaredhanson/deamdify) | yes | [rollup-plugin-amd](https://github.com/brunch/uglify-js-brunch) | yes |
16+
| AMD `define` | **yes** | **yes** | [deamdify](https://github.com/jaredhanson/deamdify) | yes | [rollup-plugin-amd](https://github.com/piuccio/rollup-plugin-amd) | yes |
1717
| AMD `require` | **yes** | **yes** | no | yes | no | yes |
1818
| AMD `require` loads on demand | **yes** | with manual configuration | no | yes | no | no |
1919
| CommonJS `exports` | **yes** | only wrapping in `define` | **yes** | yes | [commonjs-plugin](https://github.com/rollup/rollup-plugin-commonjs) | yes |

content/guides/lazy-load-react.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ class LazilyLoad extends React.Component {
8383
}
8484

8585
componentDidUpdate(previous) {
86-
if (this.props.modules === previous.modules) return null;
87-
this.load();
86+
const shouldLoad = !!Object.keys(this.props.modules).filter((key)=> {
87+
return this.props.modules[key] !== previous.modules[key];
88+
}).length;
89+
if (shouldLoad) {
90+
this.load();
91+
}
8892
}
8993

9094
componentWillUnmount() {

content/guides/migrating.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ It's no longer necessary to specify it in configuration.
257257

258258
## `ExtractTextWebpackPlugin` - breaking change
259259

260-
[ExtractTextPlugin](https://github.com/webpack/extract-text-webpack-plugin) 1.0.0 does not work with webpack v2. You will need to install ExtractTextPlugin v2 explicitly.
260+
[ExtractTextPlugin](https://github.com/webpack/extract-text-webpack-plugin) requires version 2 to work with webpack 2.
261261

262-
`npm install --save-dev extract-text-webpack-plugin@beta`
262+
`npm install --save-dev extract-text-webpack-plugin`
263263

264264
The configuration changes for this plugin are mainly syntactical.
265265

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"fetch": "scripts/fetch.sh",
3232
"init:generated": "mkdirp ./generated/loaders && mkdirp ./generated/plugins ",
3333
"lint": "run-s lint:*",
34-
"lint:links": "hyperlink -r --exclude https://opencollective.com/webpack/*/*/website build/index.html",
34+
"lint:links": "hyperlink -r --exclude https://opencollective.com/webpack/*/*/website build/index.html | ./scripts/check-links.js --skip 10",
3535
"lint:js": "eslint . --ext .js --ext .jsx",
3636
"lint:md": "eslint . --ext .md",
3737
"lint:markdown": "markdownlint --config ./.markdownlintrc **/*.md *.md ./content/**/*.md",
@@ -56,6 +56,7 @@
5656
"babel-preset-react": "^6.11.1",
5757
"copy-webpack-plugin": "^4.0.1",
5858
"css-loader": "^0.25.0",
59+
"duplexer": "^0.1.1",
5960
"eslint": "3.6.0",
6061
"eslint-loader": "^1.5.0",
6162
"eslint-plugin-markdown": "^1.0.0-beta.2",
@@ -88,6 +89,8 @@
8889
"sitemap-static": "^0.3.1",
8990
"style-loader": "^0.13.1",
9091
"tap-min": "^1.1.0",
92+
"tap-parser": "^5.3.3",
93+
"through2": "^2.0.3",
9194
"url-loader": "^0.5.7",
9295
"webpack": "^1.13.2",
9396
"webpack-dev-server": "^1.16.1",

scripts/check-links.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env node
2+
// Check piped links while allowing a fixed amount to fail
3+
// Adapted from tap-json.
4+
var parser = require('tap-parser');
5+
var through = require('through2');
6+
var duplexer = require('duplexer');
7+
var minimist = require('minimist');
8+
9+
process.stdin
10+
.pipe(checkLinks())
11+
.pipe(process.stdout);
12+
13+
function checkLinks(args) {
14+
var argv = minimist(process.argv.slice(2));
15+
var skip = argv.skip || 0;
16+
17+
var tap = parser();
18+
var out = through.obj();
19+
var dup = duplexer(tap, out);
20+
21+
var data = [];
22+
var name = null;
23+
24+
tap.on('complete', function(res) {
25+
const failures = res.failures;
26+
27+
if (failures.length > 0) {
28+
console.log(formatFailures(failures));
29+
}
30+
31+
// Fail hard only if over skip threshold
32+
if (failures.length > skip) {
33+
process.exit(1);
34+
}
35+
});
36+
37+
return dup;
38+
}
39+
40+
function formatFailures(failures) {
41+
return failures.map(function(failure) {
42+
return failure.name + '\n' + failure.diag.actual + ' at ' + failure.diag.at;
43+
}).join('\n\n');
44+
}

scripts/fetch.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ cp -rf ./content/loaders/ ./generated/loaders
77
mkdir -p ./generated/plugins
88
cp -rf ./content/plugins/ ./generated/plugins
99

10-
# Fetches github.com/webpack/*-loader repositories
11-
./scripts/fetch_package_names.js "webpack" "-loader" | ./scripts/fetch_package_files.js "README.md" "./generated/loaders"
10+
# Fetches github.com/webpack/*-loader repositories.
11+
# Skipped because they are below contrib now.
12+
# ./scripts/fetch_package_names.js "webpack" "-loader" | ./scripts/fetch_package_files.js "README.md" "./generated/loaders"
1213

13-
# Fetches github.com/webpack/*-webpack-plugin repositories
14-
./scripts/fetch_package_names.js "webpack" "-webpack-plugin" | ./scripts/fetch_package_files.js "README.md" "./generated/plugins"
14+
# Fetches github.com/webpack/*-webpack-plugin repositories.
15+
# Skipped because they are below contrib now.
16+
# ./scripts/fetch_package_names.js "webpack" "-webpack-plugin" | ./scripts/fetch_package_files.js "README.md" "./generated/plugins"
1517

1618
# Fetches github.com/webpack-contrib/*-loader repositories
1719
./scripts/fetch_package_names.js "webpack-contrib" "-loader" | ./scripts/fetch_package_files.js "README.md" "./generated/loaders"

0 commit comments

Comments
 (0)