diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 00000000000..7810041dfd8
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,27 @@
+# Ignore node_modules
+node_modules
+
+# Ignore some folders
+benchmark
+coverage
+
+# Ignore not supported files
+!.*.js
+.eslintrc.js
+*.d.ts
+
+# Ignore precompiled schemas
+schemas/**/*.check.js
+
+# 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 79cee6b118f..09a61797b11 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,6 +1,6 @@
module.exports = {
root: true,
- plugins: ["prettier", "node", "jest"],
+ plugins: ["prettier", "node", "jest", "jsdoc"],
extends: [
"eslint:recommended",
"plugin:node/recommended",
@@ -11,57 +11,74 @@ module.exports = {
es6: true
},
parserOptions: {
- ecmaVersion: 2017
+ ecmaVersion: 2018
},
rules: {
"prettier/prettier": "error",
- "no-undef": "error",
- "no-extra-semi": "error",
"no-template-curly-in-string": "error",
"no-caller": "error",
"no-control-regex": "off",
yoda: "error",
eqeqeq: "error",
- "global-require": "off",
- "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-unsafe-negation": "error",
- "no-loop-func": "warn",
- indent: "off",
- "no-console": "off",
- "valid-jsdoc": [
- "error",
- {
- prefer: {
- return: "returns",
- prop: "property",
- memberof: "DONTUSE",
- class: "DONTUSE",
- inheritdoc: "DONTUSE",
- description: "DONTUSE",
- readonly: "DONTUSE"
- },
- preferType: {
- "*": "any"
- },
- requireReturnType: true
- }
- ],
- "node/no-unsupported-features": "error",
- "node/no-deprecated-api": "error",
- "node/no-missing-import": "error",
+ "no-unused-vars": ["error", { args: "none", ignoreRestSiblings: true }],
+ "no-loop-func": "off",
"node/no-missing-require": ["error", { allowModules: ["webpack"] }],
- "node/no-unpublished-bin": "error",
- "node/no-unpublished-require": "error",
- "node/process-exit-as-throw": "error"
+ "jsdoc/check-indentation": "error",
+ "jsdoc/check-param-names": "error",
+ "jsdoc/check-property-names": "error",
+ "jsdoc/check-tag-names": "error",
+ "jsdoc/require-hyphen-before-param-description": ["error", "never"],
+ "jsdoc/require-param-description": "error",
+ "jsdoc/require-param-name": "error",
+ "jsdoc/require-param-type": "error",
+ "jsdoc/require-param": "error",
+ "jsdoc/require-property": "error",
+ "jsdoc/require-property-name": "error",
+ "jsdoc/require-property-type": "error",
+ "jsdoc/require-returns-description": "error",
+ "jsdoc/require-returns-type": "error",
+ "jsdoc/require-returns": "error",
+ // Disallow @ts-ignore directive. Use @ts-expect-error instead
+ "no-warning-comments": [
+ "error",
+ { terms: ["@ts-ignore"], location: "start" }
+ ]
+ },
+ settings: {
+ jsdoc: {
+ mode: "typescript",
+ // 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: "constructor"
+ },
+ overrideReplacesDocs: false
+ }
},
overrides: [
{
- files: ["lib/**/*.runtime.js", "buildin/*.js", "hot/*.js"],
+ files: ["lib/**/*.runtime.js", "hot/*.js"],
env: {
es6: false,
browser: true
@@ -79,7 +96,8 @@ module.exports = {
"jest/globals": true
},
globals: {
- nsObj: false
+ nsObj: false,
+ jasmine: false
}
}
]
diff --git a/.gitattributes b/.gitattributes
index ac579eb7bc0..4a65e411fbd 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,4 +1,7 @@
* text=auto
-test/statsCases/* eol=lf
+test/statsCases/** eol=lf
examples/* eol=lf
-bin/* eol=lf
\ No newline at end of file
+bin/* eol=lf
+*.svg eol=lf
+*.css eol=lf
+**/*webpack.lock.data/** -text
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.md b/.github/ISSUE_TEMPLATE.md
index 1deb4adab1a..ba313faa478 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -12,7 +12,7 @@
**If the current behavior is a bug, please provide the steps to reproduce.**
-
+
**What is the expected behavior?**
diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md
index 1b69aa08fd4..ff728e6db23 100644
--- a/.github/ISSUE_TEMPLATE/Feature_request.md
+++ b/.github/ISSUE_TEMPLATE/Feature_request.md
@@ -8,9 +8,9 @@ about: Suggest an idea for this project
## Feature request
-
+
-
+
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000000..097b6c90844
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,12 @@
+version: 2
+updates:
+- package-ecosystem: npm
+ directory: "/"
+ schedule:
+ interval: daily
+ time: "04:00"
+ timezone: Europe/Berlin
+ open-pull-requests-limit: 20
+ labels:
+ - dependencies
+ versioning-strategy: widen
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 00000000000..11a4dbe2a81
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,114 @@
+name: Test
+
+# cspell:word Ignus
+# cspell:word eslintcache
+
+on:
+ push:
+ branches:
+ - main
+ - dev-1
+ pull_request:
+ branches:
+ - main
+ - dev-1
+
+permissions:
+ contents: read
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Use Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 17.x
+ cache: "yarn"
+ - run: yarn --frozen-lockfile
+ - uses: actions/cache@v1
+ with:
+ path: .eslintcache
+ key: lint-${{ env.GITHUB_SHA }}
+ restore-keys: lint-
+ - run: yarn lint
+ basic:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Use Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 17.x
+ cache: "yarn"
+ - run: yarn --frozen-lockfile
+ - run: yarn link --frozen-lockfile || true
+ - run: yarn link webpack --frozen-lockfile
+ - run: yarn test:basic --ci
+ - uses: codecov/codecov-action@v3
+ with:
+ flags: basic
+ functionalities: gcov
+ unit:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Use Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 17.x
+ cache: "yarn"
+ - run: yarn --frozen-lockfile
+ - run: yarn link --frozen-lockfile || true
+ - run: yarn link webpack --frozen-lockfile
+ - uses: actions/cache@v1
+ with:
+ path: .jest-cache
+ key: jest-unit-${{ env.GITHUB_SHA }}
+ restore-keys: jest-unit-
+ - run: yarn cover:unit --ci --cacheDirectory .jest-cache
+ - uses: codecov/codecov-action@v3
+ with:
+ flags: unit
+ functionalities: gcov
+ integration:
+ needs: basic
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ node-version: [10.x, 17.x]
+ part: [a, b]
+ include:
+ - os: ubuntu-latest
+ node-version: 16.x
+ part: a
+ - os: ubuntu-latest
+ node-version: 14.x
+ part: a
+ - os: ubuntu-latest
+ node-version: 12.x
+ part: a
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v3
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: "yarn"
+ - run: yarn --frozen-lockfile
+ - run: yarn link --frozen-lockfile || true
+ - run: yarn link webpack --frozen-lockfile
+ - uses: actions/cache@v2
+ with:
+ path: .jest-cache
+ key: jest-integration-${{ env.GITHUB_SHA }}
+ restore-keys: jest-integration-
+ - run: yarn cover:integration:${{ matrix.part }} --ci --cacheDirectory .jest-cache || yarn cover:integration:${{ matrix.part }} --ci --cacheDirectory .jest-cache -f
+ - run: yarn cover:merge
+ - uses: codecov/codecov-action@v3
+ with:
+ flags: integration
+ functionalities: gcov
diff --git a/.gitignore b/.gitignore
index 32814bb493a..ed9bd295d03 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,22 @@
/node_modules
/test/js
/test/browsertest/js
-/test/fixtures/temp-cache-fixture
+/test/fixtures/temp-*
+/test/temp
+/test/ChangesAndRemovals
+/test/**/dev-defaults.webpack.lock
/benchmark/js
/benchmark/fixtures
/examples/**/dist
+/assembly/**/*.wat
+/assembly/**/*.wasm
/coverage
+/.nyc_output
+/.jest-cache
.DS_Store
*.log
.idea
.vscode
+.cache
.eslintcache
package-lock.json
diff --git a/.husky/.gitignore b/.husky/.gitignore
new file mode 100644
index 00000000000..31354ec1389
--- /dev/null
+++ b/.husky/.gitignore
@@ -0,0 +1 @@
+_
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 00000000000..d37daa075e2
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,4 @@
+#!/bin/sh
+. "$(dirname "$0")/_/husky.sh"
+
+npx --no-install lint-staged
diff --git a/.prettierignore b/.prettierignore
index 7ca974bc420..bf425289bd9 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,8 +1,14 @@
+package.json
+
# Ignore test fixtures
test/*.*
!test/*.js
!test/**/webpack.config.js
+!test/**/deprecations.js
# Ignore example fixtures
examples/*.*
!examples/**/webpack.config.js
+
+# Ignore generated files
+*.check.js
diff --git a/.prettierrc.js b/.prettierrc.js
index cc7e3b51355..2ddbbf13d25 100644
--- a/.prettierrc.js
+++ b/.prettierrc.js
@@ -2,12 +2,21 @@ module.exports = {
printWidth: 80,
useTabs: true,
tabWidth: 2,
+ trailingComma: "none",
+ arrowParens: "avoid",
overrides: [
{
files: "*.json",
options: {
+ parser: "json",
useTabs: false
}
+ },
+ {
+ files: "*.ts",
+ options: {
+ parser: "typescript"
+ }
}
]
};
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 4536bb37508..00000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,73 +0,0 @@
-sudo: false
-dist: trusty
-language: node_js
-
-branches:
- only:
- - master
- - next
-
-cache:
- yarn: true
- directories:
- - ".jest-cache"
- - ".eslintcache"
-
-stages:
- - basic
- - advanced
-
-matrix:
- include:
- - os: linux
- 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=lint-unit
- stage: advanced
- - os: linux
- node_js: "10"
- env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration
- stage: advanced
- - os: linux
- 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: "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_EXTRA_ARGS
- - yarn link --frozen-lockfile $YARN_EXTRA_ARGS || true
- - yarn link webpack --frozen-lockfile $YARN_EXTRA_ARGS
-
-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 -X gcov
- - rm -f .jest-cache/haste-map* .jest-cache/perf-cache*
-
-notifications:
- slack:
- secure: JduSdKWwbnLCwo7Z4E59SGE+Uw832UwnXzQiKEpg1BV45MYDPRiGltly1tRHmPh9OGjvGx3XSkC2tNGOBLtL4UL2SCkf012x0t7jDutKRfcv/njynl8jk8l+UhPmaWiHXDQAgGiiKdL4RfzPLW3HeVHCOWm0LKMzcarTa8tw+rE=
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000000..4faf227c455
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1 @@
+[Code of Conduct](https://github.com/openjs-foundation/code-and-learn/blob/master/CODE_OF_CONDUCT.md)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index da3b43b7186..146a567a0c0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -10,12 +10,12 @@ work is not in vain.
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
+a question to [StackOverflow with the webpack tag](https://stackoverflow.com/tags/webpack). Questions
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).**
-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 -
+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 -
- D0: My First Commit (Contribution Difficulty)
- D1: Easy (Contribution Difficulty)
@@ -35,22 +35,34 @@ If you have created your own loader/plugin please include it on the relevant doc
## Submitting Changes
-After getting some feedbacks, push to your fork and submit a pull request. We
+After getting some feedback, 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.
Something that will increase the chance that your pull request is accepted:
-* [Write tests](./test/README.md)
-* Follow the existing coding style
-* Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
+- [Write tests](./test/README.md)
+- Follow the existing coding style
+- Write a [good commit message](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
+- For a major fix/feature make sure your PR has an issue and if it doesn't, please create one. This would help discussion with the community, and polishing ideas in case of a new feature.
+- Make sure your PR's description contains GitHub's special keyword references that automatically close the related issue when the PR is merged. ([More info](https://github.com/blog/1506-closing-issues-via-pull-requests))
+- When you have a lot of commits in your PR, it's good practice to squash all your commits in one single commit. ([Learn how to squash here](https://davidwalsh.name/squash-commits-git))
## Documentation
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. [See a list of issues with the documentation tag.](https://github.com/webpack/webpack/labels/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
Gitter is only for small questions. To discuss a subject in detail, please send a link to your forum or blog in the Gitter chat.
+
+## Join the development
+
+- Before you join development, please [set up the project](./_SETUP.md) on your local machine, run it and go through the application completely. Use any command you can find and see what it does. Explore.
+
+ > Don't worry ... Nothing will happen to the project or to you due to the exploring. Only thing that will happen is, you'll be more familiar with what is where and might even get some cool ideas on how to improve various aspects of the project.
+
+- If you would like to work on an issue, drop in a comment at the issue. If it is already assigned to someone, but there is no sign of any work being done, please feel free to drop in a comment so that the issue can be assigned to you if the previous assignee has dropped it entirely.
diff --git a/README.md b/README.md
index d3a5d2b6b08..c712d27fd7a 100644
--- a/README.md
+++ b/README.md
@@ -8,22 +8,20 @@
[![npm][npm]][npm-url]
[![node][node]][node-url]
-[![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]
-
-
+
+
-
-
+
+
@@ -39,7 +37,7 @@
- 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. + 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.
@@ -76,67 +74,63 @@ yarn add webpack --dev