diff --git a/.editorconfig b/.editorconfig
index 7228de4053b..2bd8cf9e86d 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -2,25 +2,13 @@ root = true
[*]
indent_style = tab
-indent_size = 4
+indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
-max_line_length = 233
-
-[*.json]
-indent_style = space
-indent_size = 2
-
-[.prettierrc]
-indent_style = space
-indent_size = 2
-
-[*.yml]
-indent_style = space
-indent_size = 2
+max_line_length = 80
-[*.yaml]
+[*.{yml,yaml,json}]
indent_style = space
indent_size = 2
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 00000000000..f9f03214300
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,24 @@
+# Ignore node_modules
+node_modules
+
+# Ignore some folders
+benchmark
+coverage
+
+# Ignore not support files
+!.*.js
+.eslintrc.js
+*.d.ts
+
+# Ignore some test files
+test/*
+!test/*Cases
+!test/helpers
+!test/*.js
+test/*Cases/**/*.js
+!test/*Cases/**/webpack.config.js
+
+# Ignore some examples files
+examples/**/*.js
+!examples/*/webpack.config.js
+
diff --git a/.eslintrc.js b/.eslintrc.js
index 12149e7f6d5..69f411216f8 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,50 +1,105 @@
module.exports = {
- "root": true,
- "plugins": [
- "prettier",
- "node"
+ root: true,
+ plugins: ["prettier", "node", "jest", "jsdoc"],
+ extends: [
+ "eslint:recommended",
+ "plugin:node/recommended",
+ "plugin:prettier/recommended"
],
- "extends": ["eslint:recommended", "plugin:node/recommended"],
- "env": {
- "node": true,
- "es6": true,
- "mocha": true,
+ env: {
+ node: true,
+ es6: true
},
- "parserOptions": { "ecmaVersion": 2017 },
- "rules": {
+ parserOptions: {
+ ecmaVersion: 2017
+ },
+ rules: {
"prettier/prettier": "error",
"no-undef": "error",
"no-extra-semi": "error",
- "semi": "error",
"no-template-curly-in-string": "error",
"no-caller": "error",
- "yoda": "error",
- "eqeqeq": "error",
+ "no-control-regex": "off",
+ yoda: "error",
+ eqeqeq: "error",
"global-require": "off",
- "brace-style": "error",
+ "brace-style": "off",
"eol-last": "error",
"no-extra-bind": "warn",
"no-process-exit": "warn",
"no-use-before-define": "off",
- "no-unused-vars": ["error", { "args": "none" }],
+ "no-unused-vars": ["error", { args: "none" }],
"no-unsafe-negation": "error",
"no-loop-func": "warn",
- "indent": "off",
+ indent: "off",
"no-console": "off",
- "valid-jsdoc": "error",
"node/no-unsupported-features": "error",
"node/no-deprecated-api": "error",
"node/no-missing-import": "error",
- "node/no-missing-require": [
- "error",
- {
- "allowModules": [
- "webpack"
- ]
- }
- ],
+ "node/no-missing-require": ["error", { allowModules: ["webpack"] }],
"node/no-unpublished-bin": "error",
"node/no-unpublished-require": "error",
- "node/process-exit-as-throw": "error"
- }
+ "node/process-exit-as-throw": "error",
+ "jsdoc/require-hyphen-before-param-description": ["error", "never"],
+ "jsdoc/check-tag-names": "error",
+ "jsdoc/check-param-names": "error",
+ "jsdoc/require-param-description": "error",
+ "jsdoc/require-param-name": "error",
+ "jsdoc/require-param-type": "error",
+ "jsdoc/require-param": "error",
+ "jsdoc/require-returns-description": "error",
+ "jsdoc/require-returns-type": "error",
+ "jsdoc/require-returns": "error"
+ },
+ settings: {
+ jsdoc: {
+ // supported tags https://github.com/microsoft/TypeScript-wiki/blob/master/JSDoc-support-in-JavaScript.md
+ tagNamePreference: {
+ ...["implements", "const", "memberof", "readonly", "yields"].reduce(
+ (acc, tag) => {
+ acc[tag] = {
+ message: `@${tag} currently not supported in Typescript`
+ };
+ return acc;
+ },
+ {}
+ ),
+ extends: "extends",
+ return: "returns",
+ constructor: "constructor",
+ prop: "property",
+ arg: "param",
+ augments: "extends",
+ description: false,
+ desc: false,
+ inheritdoc: false,
+ class: false
+ },
+ overrideReplacesDocs: false
+ }
+ },
+ overrides: [
+ {
+ files: ["lib/**/*.runtime.js", "buildin/*.js", "hot/*.js"],
+ env: {
+ es6: false,
+ browser: true
+ },
+ globals: {
+ Promise: false
+ },
+ parserOptions: {
+ ecmaVersion: 5
+ }
+ },
+ {
+ files: ["test/**/*.js"],
+ env: {
+ "jest/globals": true
+ },
+ globals: {
+ nsObj: false
+ }
+ }
+ ]
};
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000000..5e7c7b6d7a6
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
+open_collective: webpack
diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md
new file mode 100644
index 00000000000..437637672bb
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/Bug_report.md
@@ -0,0 +1,39 @@
+---
+name: Bug report
+about: Create a report to help us improve
+---
+
+
+
+
+# Bug report
+
+
+
+
+
+
+**What is the current behavior?**
+
+
+**If the current behavior is a bug, please provide the steps to reproduce.**
+
+
+
+
+
+
+
+
+
+**What is the expected behavior?**
+
+
+
+
+
+**Other relevant information:**
+webpack version:
+Node.js version:
+Operating System:
+Additional tools:
diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md
new file mode 100644
index 00000000000..1b69aa08fd4
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/Feature_request.md
@@ -0,0 +1,27 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+
+---
+
+
+
+## Feature request
+
+
+
+
+
+
+
+**What is the expected behavior?**
+
+
+**What is motivation or use case for adding/changing the behavior?**
+
+
+**How should this be implemented in your opinion?**
+
+
+**Are you willing to work on this yourself?**
+yes
diff --git a/.github/ISSUE_TEMPLATE/Other.md b/.github/ISSUE_TEMPLATE/Other.md
new file mode 100644
index 00000000000..033e88fcad4
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/Other.md
@@ -0,0 +1,9 @@
+---
+name: Other
+about: Something else
+
+---
+
+
+
+
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 7af602ab91a..8967c8f0169 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,4 +1,9 @@
+
+
+
+
+
**What kind of change does this PR introduce?**
@@ -8,17 +13,11 @@
-**If relevant, link to documentation update:**
-
-
-
-**Summary**
-
-
-
-
**Does this PR introduce a breaking change?**
-**Other information**
+**What needs to be documented once your changes are merged?**
+
+
+
diff --git a/.gitignore b/.gitignore
index 1142de1e6ab..933100cc704 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,7 @@
/node_modules
/test/js
/test/browsertest/js
-/test/fixtures/temp-cache-fixture
+/test/fixtures/temp-cache-fixture*
/benchmark/js
/benchmark/fixtures
/examples/**/dist
@@ -10,3 +10,5 @@
*.log
.idea
.vscode
+.eslintcache
+package-lock.json
diff --git a/.istanbul.yml b/.istanbul.yml
index 7548269fb84..380ddeb6d88 100644
--- a/.istanbul.yml
+++ b/.istanbul.yml
@@ -1,3 +1,4 @@
instrumentation:
excludes:
- "**/*.runtime.js"
+ - ".github/*"
diff --git a/.jsbeautifyrc b/.jsbeautifyrc
deleted file mode 100644
index 79b04984674..00000000000
--- a/.jsbeautifyrc
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "js": {
- "allowed_file_extensions": ["js", "json", "jshintrc", "jsbeautifyrc"],
- "brace_style": "collapse",
- "break_chained_methods": false,
- "e4x": true,
- "eval_code": false,
- "end_with_newline": true,
- "indent_char": "\t",
- "indent_level": 0,
- "indent_size": 1,
- "indent_with_tabs": true,
- "jslint_happy": false,
- "jslint_happy_align_switch_case": true,
- "space_after_anon_function": false,
- "keep_array_indentation": false,
- "keep_function_indentation": false,
- "max_preserve_newlines": 2,
- "preserve_newlines": true,
- "space_before_conditional": false,
- "space_in_paren": false,
- "unescape_strings": false,
- "wrap_line_length": 0
- }
-}
\ No newline at end of file
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 00000000000..9cf9495031e
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+package-lock=false
\ No newline at end of file
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000000..7ca974bc420
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,8 @@
+# Ignore test fixtures
+test/*.*
+!test/*.js
+!test/**/webpack.config.js
+
+# Ignore example fixtures
+examples/*.*
+!examples/**/webpack.config.js
diff --git a/.prettierrc b/.prettierrc
deleted file mode 100644
index d2702b8a1b4..00000000000
--- a/.prettierrc
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "tabWidth": 2,
- "useTabs": true
-}
diff --git a/.prettierrc.js b/.prettierrc.js
new file mode 100644
index 00000000000..cc7e3b51355
--- /dev/null
+++ b/.prettierrc.js
@@ -0,0 +1,13 @@
+module.exports = {
+ printWidth: 80,
+ useTabs: true,
+ tabWidth: 2,
+ overrides: [
+ {
+ files: "*.json",
+ options: {
+ useTabs: false
+ }
+ }
+ ]
+};
diff --git a/.travis.yml b/.travis.yml
index a1f10e144fc..d2bcc5e2256 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,44 +4,70 @@ language: node_js
branches:
only:
+ - webpack-4
- master
- next
cache:
yarn: true
+ directories:
+ - ".jest-cache"
+ - ".eslintcache"
+
+stages:
+ - basic
+ - advanced
matrix:
include:
- os: linux
- node_js: "8"
- env: NO_WATCH_TESTS=1 JOB_PART=lint
+ node_js: "10"
+ env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=basic
+ stage: basic
+ - os: linux
+ node_js: "10"
+ env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=lintunit
+ stage: advanced
- os: linux
- node_js: "8"
- env: NO_WATCH_TESTS=1 JOB_PART=integration
+ node_js: "10"
+ env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration
+ stage: advanced
- os: linux
- node_js: "8"
- env: NO_WATCH_TESTS=1 JOB_PART=unit
+ node_js: "10"
+ env: NO_WATCH_TESTS=1 ALTERNATIVE_SORT=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration
+ stage: advanced
- os: linux
- node_js: "6"
- env: NO_WATCH_TESTS=1 JOB_PART=integration
- - os: osx
- node_js: "8"
- env: NO_WATCH_TESTS=1 JOB_PART=integration
- allow_failures:
- - os: osx
+ node_js: "10"
+ env:
+ - NODEJS_VERSION=v12.0.0-nightly20190206686043e76e
+ - YARN_EXTRA_ARGS="--ignore-engines"
+ - NO_WATCH_TESTS=1
+ - JEST="--maxWorkers=2 --cacheDirectory .jest-cache"
+ - JOB_PART=integration
+ stage: advanced
fast_finish: true
+before_install:
+ - |
+ if [ "$NODEJS_VERSION" != "" ];
+ then
+ mkdir /opt/node
+ curl --silent "https://nodejs.org/download/nightly/$NODEJS_VERSION/node-$NODEJS_VERSION-linux-x64.tar.gz" | tar -zxf - --directory /opt/node
+ export PATH="/opt/node/node-$NODEJS_VERSION-linux-x64/bin:$PATH"
+ node --version
+ fi
+
install:
- - yarn --frozen-lockfile
- - yarn link --frozen-lockfile || true
- - yarn link webpack --frozen-lockfile
+ - yarn --frozen-lockfile $YARN_EXTRA_ARGS
+ - yarn link --frozen-lockfile $YARN_EXTRA_ARGS || true
+ - yarn link webpack --frozen-lockfile $YARN_EXTRA_ARGS
-script: npm run travis:$JOB_PART
+script: yarn travis:$JOB_PART
after_success:
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose
- - bash <(curl -s https://codecov.io/bash) -F $JOB_PART
- - rm -rf ./coverage
+ - bash <(curl -s https://codecov.io/bash) -F $JOB_PART -X gcov
+ - rm -f .jest-cache/haste-map* .jest-cache/perf-cache*
notifications:
slack:
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000000..22ab3217018
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1 @@
+[Code of Conduct](https://js.foundation/community/code-of-conduct)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 369ab7a851a..76ebe22a492 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -7,46 +7,39 @@ work is not in vain.
## Issues
-Most of the time, if webpack is not working correctly for you it is a simple configuration issue.
+Most of the time, if webpack is not working correctly for you, it is a simple configuration issue.
If you are still having difficulty after looking over your configuration carefully, please post
a question to [StackOverflow with the webpack tag](http://stackoverflow.com/tags/webpack). Questions
-that include your webpack.config.js and relevant files are more likely to receive responses.
+that include your webpack.config.js, relevant files, and the full error message are more likely to receive responses.
**If you have discovered a bug or have a feature suggestion, please [create an issue on GitHub](https://github.com/webpack/webpack/issues/new).**
-## Contributing to the webpack ecosystem
+Do you want to fix an issue? Look at the issues with a tag of [X5: work required (PR / Help Wanted)](https://github.com/webpack/webpack/labels/X5%3A%20work%20required%20%28PR%20%2F%20Help%20Wanted%29). Each issue should be tagged with a difficulty tag -
-If you have created your own loader/plugin please include it on the relevant
-documentation pages:
+- D0: My First Commit (Contribution Difficulty)
+- D1: Easy (Contribution Difficulty)
+- D2: Medium (Contribution Difficulty)
+- D3: Hard (Contribution Difficulty)
-[List of loaders](https://webpack.js.org/loaders/) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#loaders)
-[List of plugins](https://webpack.js.org/plugins) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#webpack-plugins)
+## Contributing to the webpack ecosystem
-## Setup
+If you have created your own loader/plugin please include it on the relevant documentation pages:
-```bash
-git clone https://github.com/webpack/webpack.git
-cd webpack
-npm install -g yarn
-yarn install
-yarn link
-yarn link webpack
-```
+- [List of loaders](https://webpack.js.org/loaders/) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#loaders)
+- [List of plugins](https://webpack.js.org/plugins) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#webpack-plugins)
-To run the entire test suite use:
+## Setup
-```bash
-yarn test
-```
+[Setup your local webpack repository](_SETUP.md)
## Submitting Changes
-After getting some feedback, push to your fork and submit a pull request. We
+After getting some feedbacks, push to your fork and submit a pull request. We
may suggest some changes or improvements or alternatives, but for small changes
your pull request should be accepted quickly.
-Some things that will increase the chance that your pull request is accepted:
+Something that will increase the chance that your pull request is accepted:
* [Write tests](./test/README.md)
* Follow the existing coding style
@@ -56,7 +49,8 @@ Some things that will increase the chance that your pull request is accepted:
webpack is insanely feature rich and documentation is a huge time sink. We
greatly appreciate any time spent fixing typos or clarifying sections in the
-documentation.
+documentation. [See a list of issues with the documentation tag](https://github.com/webpack/webpack/labels/documentation),
+or [check out the issues on the documentation website's repository](https://github.com/webpack/webpack.js.org/issues).
## Discussions
diff --git a/README.md b/README.md
index 79cda6f2d32..cc2afef693d 100644
--- a/README.md
+++ b/README.md
@@ -11,13 +11,21 @@
[![deps][deps]][deps-url]
[![tests][tests]][tests-url]
[![builds][builds]][builds-url]
+[![builds2][builds2]][builds2-url]
[![coverage][cover]][cover-url]
[![licenses][licenses]][licenses-url]
+[![PR's welcome][prs]][prs-url]
+
+
+
+
+
+
@@ -33,9 +41,26 @@
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. -
+
+## Table of Contents + +1. [Install](#install) +2. [Introduction](#introduction) +3. [Concepts](#concepts) +4. [Contributing](#contributing) +5. [Support](#support) +6. [Core Team](#core-team) +7. [Sponsoring](#sponsoring) +8. [Premium Partners](#premium-partners) +9. [Other Backers and Sponsors](#other-backers-and-sponsors) +10. [Gold Sponsors](#gold-sponsors) +11. [Silver Sponsors](#silver-sponsors) +12. [Bronze Sponsors](#bronze-sponsors) +13. [Backers](#backers) +14. [Special Thanks](#special-thanks-to) +