diff --git a/.editorconfig b/.editorconfig
index 45137161298..07e49a0e38b 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -8,10 +8,6 @@ trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80
-[.prettierrc]
-indent_style = space
-indent_size = 2
-
[*.{yml,yaml,json}]
indent_style = space
indent_size = 2
@@ -19,5 +15,11 @@ indent_size = 2
[test/cases/parsing/bom/bomfile.{css,js}]
charset = utf-8-bom
+[test/configCases/css/no-extra-runtime-in-js/source.text]
+insert_final_newline = false
+
[*.md]
trim_trailing_whitespace = false
+
+[*.snap]
+trim_trailing_whitespace = false
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index a70d08eb0fb..00000000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,75 +0,0 @@
-module.exports = {
- root: true,
- plugins: ["prettier", "node", "jest"],
- extends: ["eslint:recommended", "plugin:node/recommended", "plugin:prettier/recommended"],
- env: {
- node: true,
- es6: true
- },
- parserOptions: {
- ecmaVersion: 2017
- },
- 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": "error",
- "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",
- "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",
- "node/no-missing-require": ["error", { allowModules: ["webpack"] }],
- "node/no-unpublished-bin": "error",
- "node/no-unpublished-require": "error",
- "node/process-exit-as-throw": "error"
- },
- 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
- }
- }
- ]
-};
diff --git a/.gitattributes b/.gitattributes
index ac579eb7bc0..360694eafb6 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,4 +1,8 @@
* text=auto
-test/statsCases/* eol=lf
+test/statsCases/** eol=lf
+test/hotCases/** 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..3b257921146 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -2,9 +2,11 @@
-**Do you want to request a *feature* or report a *bug*?**
+**Do you want to request a _feature_ or report a _bug_?**
-
+
+
+
**What is the current behavior?**
@@ -12,7 +14,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/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md
index 657747d6289..de70ffd482d 100644
--- a/.github/ISSUE_TEMPLATE/Bug_report.md
+++ b/.github/ISSUE_TEMPLATE/Bug_report.md
@@ -1,39 +1,36 @@
----
-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:
+---
+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
index e23f20d97cf..704020c0671 100644
--- a/.github/ISSUE_TEMPLATE/Feature_request.md
+++ b/.github/ISSUE_TEMPLATE/Feature_request.md
@@ -1,27 +1,23 @@
----
-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
+---
+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
index 5e5b62bd605..3faf967c321 100644
--- a/.github/ISSUE_TEMPLATE/Other.md
+++ b/.github/ISSUE_TEMPLATE/Other.md
@@ -1,9 +1,10 @@
----
-name: Other
-about: Something else
-
----
-
-
-
-
+---
+name: Other
+about: Something else
+---
+
+
+
+
+
+
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 8967c8f0169..89efe54b7d5 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -2,7 +2,6 @@
-
**What kind of change does this PR introduce?**
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000000..7b3e3b3ec5d
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,31 @@
+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
+ groups:
+ dependencies:
+ patterns:
+ - "*"
+ exclude-patterns:
+ - "eslint-scope"
+ - "json-parse-even-better-errors"
+ - "strip-ansi"
+ - "rimraf"
+ - "mime-types"
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: daily
+ time: "04:00"
+ timezone: Europe/Berlin
+ open-pull-requests-limit: 20
+ labels:
+ - dependencies
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
new file mode 100644
index 00000000000..4db2a128537
--- /dev/null
+++ b/.github/workflows/dependency-review.yml
@@ -0,0 +1,61 @@
+name: "Dependency Review"
+
+on: [pull_request]
+
+permissions:
+ contents: read
+
+jobs:
+ dependency-review:
+ runs-on: ubuntu-latest
+ steps:
+ - name: "Checkout Repository"
+ uses: actions/checkout@v4
+ - name: "Dependency Review"
+ uses: actions/dependency-review-action@v4
+ with:
+ allow-dependencies-licenses: "pkg:npm/@cspell/dict-en-common-misspellings, pkg:npm/flatted, pkg:npm/parse-imports, pkg:npm/prettier, pkg:npm/type-fest, pkg:npm/abbrev, pkg:npm/@pkgjs/parseargs, pkg:npm/cookie-signature"
+ allow-licenses: |
+ 0BSD,
+ AFL-1.1,
+ AFL-1.2,
+ AFL-2.0,
+ AFL-2.1,
+ AFL-3.0,
+ AGPL-3.0-only,
+ AGPL-3.0-or-later,
+ Apache-1.1,
+ Apache-2.0,
+ APSL-2.0,
+ Artistic-2.0,
+ BlueOak-1.0.0,
+ BSD-2-Clause,
+ BSD-3-Clause-Clear,
+ BSD-3-Clause,
+ BSL-1.0,
+ CAL-1.0,
+ CC-BY-3.0,
+ CC-BY-4.0,
+ CC-BY-SA-4.0,
+ CDDL-1.0,
+ CC0-1.0,
+ EPL-2.0,
+ GPL-2.0-only,
+ GPL-2.0-or-later,
+ GPL-2.0,
+ GPL-3.0-or-later,
+ ISC,
+ LGPL-2.0-only,
+ LGPL-2.1-only,
+ LGPL-2.1-or-later,
+ LGPL-2.1,
+ LGPL-3.0-only,
+ LGPL-3.0,
+ MIT,
+ MPL-2.0,
+ OFL-1.1,
+ PSF-2.0,
+ Python-2.0,
+ Python-2.0.1,
+ Unicode-DFS-2016,
+ Unlicense
diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml
new file mode 100644
index 00000000000..3d2f8b96ec2
--- /dev/null
+++ b/.github/workflows/examples.yml
@@ -0,0 +1,41 @@
+name: "Update examples"
+
+on:
+ schedule:
+ - cron: "0 0 * * 0"
+
+permissions:
+ contents: read
+
+jobs:
+ examples:
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: write
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Use Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: lts/*
+ cache: "yarn"
+ - run: yarn --frozen-lockfile
+ - run: yarn link --frozen-lockfile || true
+ - run: yarn link webpack --frozen-lockfile
+ - run: yarn build:examples
+ - name: Create Pull Request
+ uses: peter-evans/create-pull-request@v7
+ with:
+ token: ${{ secrets.PAT }}
+ delete-branch: true
+ commit-message: |
+ docs: update examples
+ title: |
+ docs: update examples
+ body: |
+ Update examples.
+
+ This PR was autogenerated.
+ branch: update-examples
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 00000000000..f3ca0ed4754
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,211 @@
+name: Github Actions
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Use Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: lts/*
+ cache: "yarn"
+ - run: yarn --frozen-lockfile
+ - name: Cache prettier result
+ uses: actions/cache@v4
+ with:
+ path: ./node_modules/.cache/prettier/.prettier-cache
+ key: lint-prettier-${{ runner.os }}-node-${{ hashFiles('**/yarn.lock', '**/.prettierrc.js') }}
+ restore-keys: lint-prettier-
+ - name: Cache eslint result
+ uses: actions/cache@v4
+ with:
+ path: .eslintcache
+ key: lint-eslint-${{ runner.os }}-node-${{ hashFiles('**/yarn.lock', '**/eslint.config.mjs') }}
+ restore-keys: lint-eslint-
+ - name: Cache cspell result
+ uses: actions/cache@v4
+ with:
+ path: .cspellcache
+ key: lint-cspell-${{ runner.os }}-node-${{ hashFiles('**/yarn.lock', '**/cspell.json') }}
+ restore-keys: lint-cspell-
+ - run: yarn lint
+ - name: Validate types using old typescript version
+ run: |
+ yarn upgrade typescript@5.0
+ yarn --frozen-lockfile
+ yarn validate:types
+ validate-legacy-node:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Use Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 10.x
+ cache: "yarn"
+ # Remove `devDependencies` from `package.json` to avoid `yarn install` compatibility error
+ - run: node -e "const content = require('./package.json');delete content.devDependencies;require('fs').writeFileSync('package.json', JSON.stringify(content, null, 2));"
+ - run: yarn install --production --frozen-lockfile
+ benchmark:
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1/4, 2/4, 3/4, 4/4]
+ runs-on: ubuntu-latest
+ permissions:
+ issues: write
+ pull-requests: write
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-tags: true
+ fetch-depth: 0
+ - name: Use Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: lts/*
+ cache: "yarn"
+ - run: yarn --frozen-lockfile
+ - run: yarn link --frozen-lockfile || true
+ - run: yarn link webpack --frozen-lockfile
+ - name: Run benchmarks
+ uses: CodSpeedHQ/action@v3
+ with:
+ run: yarn benchmark --ci
+ token: ${{ secrets.CODSPEED_TOKEN }}
+ env:
+ LAST_COMMIT: 1
+ NEGATIVE_FILTER: on-schedule
+ SHARD: ${{ matrix.shard }}
+ basic:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Use Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: lts/*
+ cache: "yarn"
+ - run: yarn --frozen-lockfile
+ - run: yarn link --frozen-lockfile || true
+ - run: yarn link webpack --frozen-lockfile
+ - run: yarn test:basic --ci
+ unit:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Use Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: lts/*
+ cache: "yarn"
+ - run: yarn --frozen-lockfile
+ - run: yarn link --frozen-lockfile || true
+ - run: yarn link webpack --frozen-lockfile
+ - uses: actions/cache@v4
+ with:
+ path: .jest-cache
+ key: jest-unit-${{ env.GITHUB_SHA }}
+ restore-keys: jest-unit-${{ hashFiles('**/yarn.lock', '**/jest.config.js') }}
+ - run: yarn cover:unit --ci --cacheDirectory .jest-cache
+ - uses: codecov/codecov-action@v5
+ with:
+ flags: unit
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
+ integration:
+ needs: basic
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ node-version: [10.x, 20.x, 22.x, 24.x]
+ part: [a, b]
+ include:
+ # Test with main branches of webpack dependencies
+ - os: ubuntu-latest
+ node-version: lts/*
+ part: a
+ use_main_branches: 1
+ - os: ubuntu-latest
+ node-version: lts/*
+ part: b
+ use_main_branches: 1
+ # Test on old Node.js versions
+ - os: ubuntu-latest
+ node-version: 18.x
+ part: a
+ - 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@v4
+ - uses: actions/github-script@v7
+ id: calculate_architecture
+ with:
+ result-encoding: string
+ script: |
+ if ('${{ matrix.os }}' === 'macos-latest' && '${{ matrix['node-version'] }}' === '10.x') {
+ return "x64"
+ } else {
+ return ''
+ }
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node-version }}
+ architecture: ${{ steps.calculate_architecture.outputs.result }}
+ cache: "yarn"
+ # Install old `jest` version and deps for legacy node versions
+ - run: |
+ yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 @types/jest@^27.4.0 pretty-format@^27.0.2 husky@^8.0.3 lint-staged@^13.2.1 cspell@^6.31.1 open-cli@^7.2.0 coffee-loader@^1.0.0 babel-loader@^8.1.0 style-loader@^2.0.0 css-loader@^5.0.1 less-loader@^8.1.1 mini-css-extract-plugin@^1.6.1 nyc@^15.1.0 --ignore-engines
+ yarn --frozen-lockfile --ignore-engines
+ if: matrix.node-version == '10.x' || matrix.node-version == '12.x' || matrix.node-version == '14.x'
+ - run: |
+ yarn upgrade husky@^8.0.3 lint-staged@^13.2.1 nyc@^15.1.0 coffee-loader@1.0.0 babel-loader@^8.1.0 style-loader@^2.0.0 css-loader@^5.0.1 less-loader@^8.1.1 mini-css-extract-plugin@^1.6.1 --ignore-engines
+ yarn --frozen-lockfile
+ if: matrix.node-version == '16.x'
+ - run: |
+ yarn upgrade cspell@^8.8.4 lint-staged@^15.2.5 --ignore-engines
+ yarn --frozen-lockfile
+ if: matrix.node-version == '18.x'
+ # Install main version of our deps
+ - run: yarn upgrade enhanced-resolve@webpack/enhanced-resolve#main loader-runner@webpack/loader-runner#main webpack-sources@webpack/webpack-sources#main watchpack@webpack/watchpack#main tapable@webpack/tapable#main
+ if: matrix.use_main_branches == '1'
+ # Install dependencies for LTS node versions
+ - run: yarn --frozen-lockfile
+ if: matrix.node-version != '10.x' && matrix.node-version != '12.x' && matrix.node-version != '14.x' && matrix.node-version != '16.x'
+ - run: yarn link --frozen-lockfile || true
+ - run: yarn link webpack --frozen-lockfile
+ - uses: actions/cache@v4
+ with:
+ path: .jest-cache
+ key: jest-integration-${{ env.GITHUB_SHA }}
+ restore-keys: jest-integration-${{ hashFiles('**/yarn.lock', '**/jest.config.js') }}
+ - 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@v5
+ with:
+ flags: integration
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 32814bb493a..20ee74c931a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,23 @@
/node_modules
/test/js
/test/browsertest/js
-/test/fixtures/temp-cache-fixture
-/benchmark/js
-/benchmark/fixtures
+/test/fixtures/temp-*
+/test/temp
+/test/ChangesAndRemovals
+/test/**/dev-defaults.webpack.lock
+/test/**/generated/**
/examples/**/dist
+/examples/nodejs-addons/build/**
+/assembly/**/*.wat
+/assembly/**/*.wasm
/coverage
+/.nyc_output
+/.jest-cache
.DS_Store
*.log
.idea
.vscode
+.cache
.eslintcache
+.cspellcache
package-lock.json
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 00000000000..041c660c92b
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1 @@
+npx --no-install lint-staged
diff --git a/.prettierignore b/.prettierignore
index c99674c1822..ebf1141fc83 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,15 +1,39 @@
-# Ignore all paths.
-**/*.*
-
-# Enable prettier for the following paths.
-!setup/**/*.js
-!lib/**/*.js
-!bin/*.js
-!hot/*.js
-!buildin/*.js
-!benchmark/**/*.js
+package.json
+
+# Ignore some test files
+test/**/*.*
!test/*.js
+!test/*.cjs
+!test/*.mjs
!test/**/webpack.config.js
+!test/**/webpack.config.cjs
+!test/**/webpack.config.mjs
+!test/**/test.config.js
+!test/**/test.filter.js
+!test/**/errors.js
+!test/**/warnings.js
+!test/**/deprecations.js
+!test/**/infrastructure-log.js
+!test/*.md
+!test/helpers/*.*
+!test/benchmarkCases/**/*.mjs
+test/js/**/*.*
+
+# Ignore some folders
+benchmark/
+coverage/
+
+# Ignore generated files
+*.check.js
+*.check.d.ts
+types.d.ts
+declarations/WebpackOptions.d.ts
+
+# Ignore precompiled schemas
+schemas/**/*.check.js
+
+# Ignore example fixtures
+examples/
!examples/**/webpack.config.js
-!schemas/**/*.js
-!declarations.d.ts
+
+.vscode/**/*.*
diff --git a/.prettierrc.js b/.prettierrc.js
index 03b9da1bac3..52e3a560973 100644
--- a/.prettierrc.js
+++ b/.prettierrc.js
@@ -1,5 +1,22 @@
module.exports = {
printWidth: 80,
useTabs: true,
- tabWidth: 2
+ tabWidth: 2,
+ trailingComma: "none",
+ arrowParens: "avoid",
+ overrides: [
+ {
+ files: "*.json",
+ options: {
+ parser: "json",
+ useTabs: false
+ }
+ },
+ {
+ files: "*.{cts,mts,ts}",
+ options: {
+ parser: "typescript"
+ }
+ }
+ ]
};
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 184cf5ee220..00000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-sudo: false
-dist: trusty
-language: node_js
-
-branches:
- only:
- - master
- - next
-
-cache:
- yarn: true
- directories:
- - ".jest-cache"
- - ".eslintcache"
-
-stages:
- - basic
- - advanced
- - versions
-
-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: osx
- node_js: "10"
- env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration
- stage: versions
- - os: linux
- node_js: "8"
- env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration
- stage: versions
- - os: linux
- node_js: "6"
- env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration
- stage: versions
- fast_finish: true
- allow_failures:
- - os: osx
-
-install:
- - yarn --frozen-lockfile
- - yarn link --frozen-lockfile || true
- - yarn link webpack --frozen-lockfile
-
-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 3364e380801..7ade9adab17 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -7,20 +7,22 @@ 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
+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). Here are some of the key labels you may encounter:
-- D0: My First Commit (Contribution Difficulty)
-- D1: Easy (Contribution Difficulty)
-- D2: Medium (Contribution Difficulty)
-- D3: Hard (Contribution Difficulty)
+- **bug**: An unexpected problem or unintended behavior.
+- **enhancement**: A suggestion for a new feature or improvement.
+- **question**: Requests for clarification or more information.
+- **documentation**: Issues related to improving or adding documentation.
+
+> **Note:** Previous references to labels such as `D0: My First Commit`, `D1: Easy`, `D2: Medium`, and `D3: Hard` have been removed as these are not currently in use. If you would like to see difficulty labels added, please open a suggestion or discuss with maintainers.
## Contributing to the webpack ecosystem
@@ -39,18 +41,43 @@ 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.
-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
-* 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))
+- For a better understanding of the folder structure and testing procedures, refer to the [Testing Documentation](./TESTING_DOCS.md).
## 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).
+
+## Types
+
+webpack is statically typed using JSDoc annotation and TypeScript. If you would like to export a new type which doesn't belong to a public API, then you can do so by declaring it in `webpack/lib/index.js`.
+
+`webpack/lib/index.js`
+
+```js
+/** @typedef {import("./NormalModuleFactory").ResolveData} ResolveData */
+```
+
+Then, automatically generate the type declarations by running `yarn fix` locally, and the changes you have made will be reflected in `types.d.ts`.
## 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/GOVERNANCE.md b/GOVERNANCE.md
new file mode 100644
index 00000000000..6d004f58610
--- /dev/null
+++ b/GOVERNANCE.md
@@ -0,0 +1,3 @@
+# webpack Project Governance
+
+The webpack project (and organization) follows the webpack's governance model defined within [the webpack governance repository](https://github.com/webpack/governance/blob/main/README.md).
diff --git a/README.md b/README.md
index 3a3c583cf2b..2149c2f2126 100644
--- a/README.md
+++ b/README.md
@@ -8,41 +8,44 @@
[![npm][npm]][npm-url]
[![node][node]][node-url]
-[![deps][deps]][deps-url]
-[![tests][tests]][tests-url]
-[![builds][builds]][builds-url]
+[![builds1][builds1]][builds1-url]
+[![dependency-review][dependency-review]][dependency-review-url]
[![coverage][cover]][cover-url]
-[![licenses][licenses]][licenses-url]
+[![PR's welcome][prs]][prs-url]
+[](https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates#about-compatibility-scores)
+[](https://npmcharts.com/compare/webpack?minimal=true)
+[](https://packagephobia.com/result?p=webpack)
+[](https://opencollective.com/webpack#backer)
+[](https://opencollective.com/webpack#sponsors)
+[](https://github.com/webpack/webpack/graphs/contributors)
+[](https://github.com/webpack/webpack/discussions)
+[](https://discord.gg/5sxFZPdx2k)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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.
-