Skip to content

Commit

Permalink
Merge branch 'main' into feature/errors-warnings-space
Browse files Browse the repository at this point in the history
  • Loading branch information
vankop committed Apr 12, 2023
2 parents e4a024f + c07ca8e commit e6c7a57
Show file tree
Hide file tree
Showing 171 changed files with 5,063 additions and 3,802 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.js
Expand Up @@ -90,6 +90,13 @@ module.exports = {
ecmaVersion: 5
}
},
{
files: ["tooling/**/*.js"],
env: { es6: true },
parserOptions: {
ecmaVersion: 2020
}
},
{
files: ["test/**/*.js"],
env: {
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/test.yml
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 17.x
node-version: 16.x
cache: "yarn"
- run: yarn --frozen-lockfile
- uses: actions/cache@v3
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 17.x
node-version: 16.x
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn link --frozen-lockfile || true
Expand All @@ -50,14 +50,26 @@ jobs:
with:
flags: basic
functionalities: gcov
validate-legacy-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
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
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 17.x
node-version: 16.x
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn link --frozen-lockfile || true
Expand All @@ -78,9 +90,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10.x, 17.x]
node-version: [10.x, 19.x]
part: [a, b]
include:
- os: ubuntu-latest
node-version: 18.x
part: a
- os: ubuntu-latest
node-version: 16.x
part: a
Expand All @@ -98,7 +113,13 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
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 --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 --frozen-lockfile
if: matrix.node-version != '10.x' && matrix.node-version != '12.x' && matrix.node-version != '14.x'
- run: yarn link --frozen-lockfile || true
- run: yarn link webpack --frozen-lockfile
- uses: actions/cache@v3
Expand Down
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions .husky/pre-commit
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install lint-staged
30 changes: 29 additions & 1 deletion azure-pipelines.yml
Expand Up @@ -60,7 +60,7 @@ jobs:
steps:
- task: NodeTool@0
inputs:
versionSpec: "^14.0.0"
versionSpec: "^16.0.0"
displayName: "Install Node.js"
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
Expand Down Expand Up @@ -141,8 +141,15 @@ jobs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
# Install old `jest` version and ignore platform problem for legacy node versions
- script: |
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 --ignore-engines
yarn --frozen-lockfile --ignore-engines
displayName: "Install dependencies (old node.js version)"
condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0'))
- script: yarn --frozen-lockfile
displayName: "Install dependencies"
condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0')))
- script: yarn link --frozen-lockfile || true
displayName: "Link webpack"
continueOnError: true
Expand Down Expand Up @@ -207,13 +214,24 @@ jobs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
# Install old `jest` version and ignore platform problem for legacy node versions
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
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 --ignore-engines
yarn --frozen-lockfile --ignore-engines
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies (old node.js version)"
condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0'), eq(variables['node_version'], '^14.0.0'))
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn --frozen-lockfile
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies"
condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0')), not(eq(variables['node_version'], '^14.0.0')))
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
Expand Down Expand Up @@ -269,13 +287,23 @@ jobs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
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 --ignore-engines
yarn --frozen-lockfile --ignore-engines
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies (old node.js version)"
condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0'))
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn --frozen-lockfile
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies"
condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0')))
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
Expand Down
7 changes: 6 additions & 1 deletion cspell.json
Expand Up @@ -5,6 +5,8 @@
"absolutify",
"acircular",
"amdmodule",
"analyse",
"analysed",
"asmjs",
"assemblyscript",
"asyncloader",
Expand Down Expand Up @@ -181,6 +183,7 @@
"preloaded",
"preloading",
"preparsed",
"preprocess",
"prettierrc",
"prewalking",
"prioritise",
Expand Down Expand Up @@ -294,6 +297,7 @@
"types.d.ts",
"**/**/*.snap",
"test/cases/json/weird-properties/globals.json",
"test/JavascriptParser.unittest.js",
"**/*.svg",
"*.log",
"**/*.wasm",
Expand All @@ -303,6 +307,7 @@
"test/cases/**",
"test/configCases/**",
"test/statsCases/**",
"test/fixtures/**"
"test/fixtures/**",
"test/memoryLimitCases/**"
]
}
4 changes: 1 addition & 3 deletions examples/README.md
Expand Up @@ -50,16 +50,14 @@
[two-explicit-vendor-chunks](two-explicit-vendor-chunks)

## Code Splitted
[code-splitted-css-bundle](code-splitted-css-bundle)

[code-splitted-require.context-amd](code-splitted-require.context-amd) example demonstrating contexts in a code-split environment with AMD.

[code-splitted-require.context](code-splitted-require.context) example demonstrating contexts in a code-split environment.

## Code Splitting
[code-splitting](code-splitting) example demonstrating a very simple case of Code Splitting.

[code-splitting-bundle-loader](code-splitting-bundle-loader) example demonstrating Code Splitting through the builder loader
[code-splitting-bundle-loader](code-splitting-bundle-loader) example demonstrating Code Splitting through the bundle loader

[code-splitting-harmony](code-splitting-harmony)

Expand Down
34 changes: 17 additions & 17 deletions examples/aggressive-merging/README.md
Expand Up @@ -60,20 +60,20 @@ module.exports = {
## Unoptimized

```
asset pageA.bundle.js 8.91 KiB [emitted] (name: pageA)
asset pageB.bundle.js 8.91 KiB [emitted] (name: pageB)
asset pageC.bundle.js 8.91 KiB [emitted] (name: pageC)
asset pageA.bundle.js 8.9 KiB [emitted] (name: pageA)
asset pageB.bundle.js 8.9 KiB [emitted] (name: pageB)
asset pageC.bundle.js 8.9 KiB [emitted] (name: pageC)
asset 456.chunk.js 6.28 KiB [emitted]
asset 394.chunk.js 606 bytes [emitted]
chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageB pageB
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageB.js 69 bytes [built] [code generated]
[used exports unknown]
entry ./pageB pageB
chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageC pageC
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageC.js 68 bytes [built] [code generated]
[used exports unknown]
entry ./pageC pageC
Expand All @@ -89,9 +89,9 @@ chunk (runtime: pageC) 394.chunk.js 42 bytes [rendered]
cjs self exports reference ./b.js 1:0-14
cjs require ./b ./pageB.js 2:8-22
cjs require ./b ./pageC.js 2:17-31
chunk (runtime: pageA) pageA.bundle.js (pageA) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageA) pageA.bundle.js (pageA) 69 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageA pageA
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageA.js 69 bytes [built] [code generated]
[used exports unknown]
entry ./pageA pageA
Expand All @@ -113,7 +113,7 @@ chunk (runtime: pageA, pageB) 456.chunk.js 5.45 KiB [rendered]
cjs self exports reference ./common.js 1:0-14
amd require ./common ./pageA.js 1:0-3:2
amd require ./common ./pageB.js 1:0-3:2
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

## Production mode
Expand All @@ -124,15 +124,15 @@ asset pageA.bundle.js 1.73 KiB [emitted] [minimized] (name: pageA)
asset pageB.bundle.js 1.73 KiB [emitted] [minimized] (name: pageB)
asset 456.chunk.js 155 bytes [emitted] [minimized]
asset 394.chunk.js 104 bytes [emitted] [minimized]
chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageB pageB
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageB.js 69 bytes [built] [code generated]
[no exports used]
entry ./pageB pageB
chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageC pageC
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageC.js 68 bytes [built] [code generated]
[no exports used]
entry ./pageC pageC
Expand All @@ -148,9 +148,9 @@ chunk (runtime: pageC) 394.chunk.js 42 bytes [rendered]
cjs self exports reference ./b.js 1:0-14
cjs require ./b ./pageB.js 2:8-22
cjs require ./b ./pageC.js 2:17-31
chunk (runtime: pageA) pageA.bundle.js (pageA) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageA) pageA.bundle.js (pageA) 69 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageA pageA
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageA.js 69 bytes [built] [code generated]
[no exports used]
entry ./pageA pageA
Expand All @@ -172,5 +172,5 @@ chunk (runtime: pageA, pageB) 456.chunk.js 5.45 KiB [rendered]
cjs self exports reference ./common.js 1:0-14
amd require ./common ./pageA.js 1:0-3:2
amd require ./common ./pageB.js 1:0-3:2
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
2 changes: 1 addition & 1 deletion examples/asset-advanced/README.md
Expand Up @@ -196,5 +196,5 @@ chunk (runtime: main) output.js (main) 1.54 KiB (javascript) 274 bytes (runtime)
[no exports]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
4 changes: 2 additions & 2 deletions examples/asset-simple/README.md
Expand Up @@ -68,7 +68,7 @@ module.exports = {
\*************************/
/*! default exports */
/*! exports [not provided] [no usage info] */
/*! runtime requirements: module, __webpack_require__.p, __webpack_require__.* */
/*! runtime requirements: __webpack_require__.p, module, __webpack_require__.* */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

module.exports = __webpack_require__.p + "images/89a353e9c515885abd8e.png";
Expand Down Expand Up @@ -217,5 +217,5 @@ chunk (runtime: main) output.js (main) 9.58 KiB (javascript) 14.6 KiB (asset) 30
[no exports]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

0 comments on commit e6c7a57

Please sign in to comment.