Skip to content

Commit c3d1806

Browse files
authored
Merge branch 'master' into patch-2
2 parents 2fa741f + fc2feaf commit c3d1806

File tree

537 files changed

+21125
-13490
lines changed

Some content is hidden

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

537 files changed

+21125
-13490
lines changed

.editorconfig

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@ trim_trailing_whitespace = true
88
insert_final_newline = true
99
max_line_length = 233
1010

11-
[*.json]
11+
[.prettierrc]
1212
indent_style = space
1313
indent_size = 2
1414

15-
[*.yml]
16-
indent_style = space
17-
indent_size = 2
18-
19-
[*.yaml]
15+
[*.{yml,yaml,json}]
2016
indent_style = space
2117
indent_size = 2
2218

.eslintrc.js

Lines changed: 28 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
module.exports = {
2-
"root": true,
3-
"plugins": ["node"],
4-
"extends": ["eslint:recommended", "plugin:node/recommended"],
5-
"env": {
6-
"node": true,
7-
"es6": true,
8-
"mocha": true,
2+
root: true,
3+
plugins: ["prettier", "node"],
4+
extends: ["eslint:recommended", "plugin:node/recommended"],
5+
env: {
6+
node: true,
7+
es6: true
98
},
10-
"parserOptions": { "ecmaVersion": 2017 },
11-
"rules": {
12-
"quotes": ["error", "double"],
9+
parserOptions: {
10+
ecmaVersion: 2017
11+
},
12+
rules: {
13+
"prettier/prettier": "error",
1314
"no-undef": "error",
1415
"no-extra-semi": "error",
1516
"semi": "error",
@@ -21,51 +22,34 @@ module.exports = {
2122
"brace-style": "error",
2223
"eol-last": "error",
2324
"no-extra-bind": "warn",
24-
"no-empty": "off",
25-
"no-multiple-empty-lines": "error",
26-
"no-multi-spaces": "error",
2725
"no-process-exit": "warn",
28-
"space-in-parens": "error",
29-
"no-trailing-spaces": "error",
3026
"no-use-before-define": "off",
31-
"no-unused-vars": ["error", { "args": "none" }],
32-
"key-spacing": "error",
33-
"space-infix-ops": "error",
27+
"no-unused-vars": ["error", { args: "none" }],
3428
"no-unsafe-negation": "error",
3529
"no-loop-func": "warn",
36-
"space-before-function-paren": ["error", "never"],
37-
"space-before-blocks": "error",
38-
"object-curly-spacing": ["error", "always"],
3930
"indent": "off",
40-
"keyword-spacing": ["error", {
41-
"after": false,
42-
"overrides": {
43-
"const": { "after": true },
44-
"try": { "after": true },
45-
"else": { "after": true },
46-
"throw": { "after": true },
47-
"case": { "after": true },
48-
"return": { "after": true },
49-
"finally": { "after": true },
50-
"do": { "after": true },
51-
"of": { "after": true }
52-
}
53-
}],
5431
"no-console": "off",
5532
"valid-jsdoc": "error",
5633
"node/no-unsupported-features": "error",
5734
"node/no-deprecated-api": "error",
5835
"node/no-missing-import": "error",
59-
"node/no-missing-require": [
60-
"error",
61-
{
62-
"allowModules": [
63-
"webpack"
64-
]
65-
}
66-
],
36+
"node/no-missing-require": ["error", { allowModules: ["webpack"] }],
6737
"node/no-unpublished-bin": "error",
6838
"node/no-unpublished-require": "error",
6939
"node/process-exit-as-throw": "error"
70-
}
40+
},
41+
overrides: [
42+
{
43+
files: ["lib/**/*.runtime.js", "buildin/*.js", "hot/*.js"],
44+
env: {
45+
es6: false
46+
},
47+
globals: {
48+
Promise: false,
49+
},
50+
parserOptions: {
51+
ecmaVersion: 5
52+
}
53+
}
54+
]
7155
};

.jsbeautifyrc

Lines changed: 0 additions & 25 deletions
This file was deleted.

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": true
4+
}

CONTRIBUTING.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,7 @@ If you have created your own loader/plugin please include it on the relevant doc
3131

3232
## Setup
3333

34-
```bash
35-
git clone https://github.com/webpack/webpack.git
36-
cd webpack
37-
npm install -g yarn
38-
yarn
39-
yarn link
40-
yarn link webpack
41-
```
42-
43-
To run the entire test suite use:
44-
45-
```bash
46-
yarn test
47-
```
34+
[Setup your local webpack repository](_SETUP.md)
4835

4936
## Submitting Changes
5037

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22
<a href="https://github.com/webpack/webpack">
3-
<img width="200" heigth="200" src="https://webpack.js.org/assets/icon-square-big.svg">
3+
<img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
44
</a>
55
<br>
66
<br>
@@ -15,7 +15,7 @@
1515
[![licenses][licenses]][licenses-url]
1616

1717
<br>
18-
<a href="https://npmjs.com/package/webpack">
18+
<a href="https://npmcharts.com/compare/webpack?minimal=true">
1919
<img src="https://img.shields.io/npm/dm/webpack.svg">
2020
</a>
2121
<a href="https://opencollective.com/webpack#backer">
@@ -33,7 +33,7 @@
3333
<h1>webpack</h1>
3434
<p>
3535
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.
36-
<p>
36+
</p>
3737
</div>
3838

3939
<h2 align="center">Install</h2>
@@ -81,14 +81,12 @@ within webpack itself use this plugin interface. This makes webpack very
8181

8282
|Name|Status|Description|
8383
|:--:|:----:|:----------|
84-
|[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)|
8584
|[extract-text-webpack-plugin][extract]|![extract-npm]|Extracts Text (CSS) from your bundles into a separate file (app.bundle.css)|
8685
|[compression-webpack-plugin][compression]|![compression-npm]|Prepares compressed versions of assets to serve them with Content-Encoding|
8786
|[i18n-webpack-plugin][i18n]|![i18n-npm]|Adds i18n support to your bundles|
8887
|[html-webpack-plugin][html-plugin]|![html-plugin-npm]| Simplifies creation of HTML files (`index.html`) to serve your bundles|
8988

9089

91-
[common]: https://github.com/webpack/webpack/blob/master/lib/optimize/CommonsChunkPlugin.js
9290
[common-npm]: https://img.shields.io/npm/v/webpack.svg
9391
[extract]: https://github.com/webpack/extract-text-webpack-plugin
9492
[extract-npm]: https://img.shields.io/npm/v/extract-text-webpack-plugin.svg
@@ -184,7 +182,7 @@ or are automatically applied via regex from your webpack configuration.
184182

185183
|Name|Status|Description|
186184
|:--:|:----:|:----------|
187-
|<a href="https://github.com/webpack/style-loader">`<style>`|![style-npm]|Add exports of a module as style to DOM|
185+
|<a href="https://github.com/webpack/style-loader">`<style>`</a>|![style-npm]|Add exports of a module as style to DOM|
188186
|<a href="https://github.com/webpack/css-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/css-3.svg"></a>|![css-npm]|Loads CSS file with resolved imports and returns CSS code|
189187
|<a href="https://github.com/webpack/less-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/less-63.svg"></a>|![less-npm]|Loads and compiles a LESS file|
190188
|<a href="https://github.com/jtangelder/sass-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/sass-1.svg"></a>|![sass-npm]|Loads and compiles a SASS/SCSS file|
@@ -344,7 +342,7 @@ If you have discovered a 🐜 or have a feature suggestion, feel free to create
344342
<a href="https://github.com/spacek33z">Kees Kluskens</a>
345343
<p>Development</p>
346344
<br>
347-
<p>Sponsor<p>
345+
<p>Sponsor</p>
348346
<a href="https://codeyellow.nl/">
349347
<img height="15px" src="https://cloud.githubusercontent.com/assets/1365881/20286583/ad62eb04-aac7-11e6-9c14-a0fef35b9b56.png">
350348
</a>
@@ -371,7 +369,7 @@ This is how we use the donations:
371369
<h2 align="center">Premium Partners</h2>
372370

373371
<div align="center">
374-
372+
375373
<a href="https://www.ag-grid.com/?utm_source=webpack&utm_medium=banner&utm_campaign=sponsorship" target="_blank"><img align="center" src="https://raw.githubusercontent.com/webpack/media/2b399d58/horiz-banner-ad-ag-grid.png">
376374
</a>
377375

@@ -382,11 +380,11 @@ This is how we use the donations:
382380
Before we started using OpenCollective, donations were made anonymously. Now that we have made the switch, we would like to acknowledge these sponsors (and the ones who continue to donate using OpenCollective). If we've missed someone, please send us a PR, and we'll add you to this list.
383381

384382
<div align="center">
385-
383+
386384
[Google Angular Team](https://angular.io/), [Architects.io](http://architects.io/),
387-
<a href="https://moonmail.io" target="_blank" title="Email Marketing Software"><img
388-
src="https://static.moonmail.io/moonmail-logo.svg" height="30" alt="MoonMail"></a>
389-
<a href="https://monei.net" target="_blank" title="Best payment gateway rates"><img
385+
<a href="https://moonmail.io" target="_blank" title="Email Marketing Software"><img
386+
src="https://static.moonmail.io/moonmail-logo.svg" height="30" alt="MoonMail"></a>
387+
<a href="https://monei.net" target="_blank" title="Best payment gateway rates"><img
390388
src="https://static.monei.net/monei-logo.svg" height="30" alt="MONEI"></a>
391389

392390
</div>

_SETUP.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Setup
2+
3+
Setup your local webpack repository
4+
5+
```bash
6+
git clone https://github.com/webpack/webpack.git
7+
cd webpack
8+
npm install -g yarn
9+
yarn install
10+
yarn link
11+
yarn link webpack
12+
```
13+
14+
To run the entire test suite use:
15+
16+
```bash
17+
yarn test
18+
```

bin/webpack.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ let webpackCliInstalled = false;
44
try {
55
require.resolve("webpack-cli");
66
webpackCliInstalled = true;
7-
} catch(e) {
7+
} catch (e) {
88
webpackCliInstalled = false;
99
}
1010

11-
if(webpackCliInstalled) {
11+
if (webpackCliInstalled) {
1212
require("webpack-cli"); // eslint-disable-line node/no-missing-require, node/no-extraneous-require, node/no-unpublished-require
1313
} else {
1414
console.error("The CLI moved into a separate package: webpack-cli.");
15-
console.error("Please install 'webpack-cli' in addition to webpack itself to use the CLI.");
15+
console.error(
16+
"Please install 'webpack-cli' in addition to webpack itself to use the CLI."
17+
);
1618
console.error("-> When using npm: npm install webpack-cli -D");
1719
console.error("-> When using yarn: yarn add webpack-cli -D");
1820
process.exitCode = 1;

buildin/global.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ g = (function() {
77

88
try {
99
// This works if eval is allowed (see CSP)
10-
g = g || Function("return this")() || (1,eval)("this");
11-
} catch(e) {
10+
g = g || Function("return this")() || (1, eval)("this");
11+
} catch (e) {
1212
// This works if the window reference is available
13-
if(typeof window === "object")
14-
g = window;
13+
if (typeof window === "object") g = window;
1514
}
1615

1716
// g can still be undefined, but nothing to do about it...

buildin/harmony-module.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = function(originalModule) {
2-
if(!originalModule.webpackPolyfill) {
2+
if (!originalModule.webpackPolyfill) {
33
var module = Object.create(originalModule);
44
// module.parent = undefined by default
5-
if(!module.children) module.children = [];
5+
if (!module.children) module.children = [];
66
Object.defineProperty(module, "loaded", {
77
enumerable: true,
88
get: function() {
@@ -16,7 +16,7 @@ module.exports = function(originalModule) {
1616
}
1717
});
1818
Object.defineProperty(module, "exports", {
19-
enumerable: true,
19+
enumerable: true
2020
});
2121
module.webpackPolyfill = 1;
2222
}

0 commit comments

Comments
 (0)