Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(en): merge webpack.js.org/master into webpack.js.org/cn @ 2b9fc4d9 #1720

Closed
wants to merge 57 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c88ec92
docs(configuration): move `name` option to correct place (#6407)
Coly010 Sep 20, 2022
a82ed1b
build(deps-dev): bump webpack-dev-server from 4.11.0 to 4.11.1 (#6409)
dependabot[bot] Sep 20, 2022
3b68bd6
build(deps-dev): bump eslint-plugin-mdx from 2.0.4 to 2.0.5 (#6410)
dependabot[bot] Sep 20, 2022
7c2cc4e
docs(guides): add emit section for asset modules (#6411)
chenxsan Sep 21, 2022
a061579
build(deps-dev): bump lightningcss from 1.15.1 to 1.16.0 (#6412)
dependabot[bot] Sep 21, 2022
1d43859
docs(api): improve logging api (#6413)
chenxsan Sep 21, 2022
9060a92
build(deps-dev): bump autoprefixer from 10.4.11 to 10.4.12 (#6414)
dependabot[bot] Sep 22, 2022
0ccd06c
build(deps-dev): bump sass from 1.54.9 to 1.55.0 (#6416)
dependabot[bot] Sep 23, 2022
97e2ef2
build(deps): bump react-router-dom from 6.4.0 to 6.4.1 (#6417)
dependabot[bot] Sep 23, 2022
10fd714
CI: running e2e tests with Chrome (#6415)
chenxsan Sep 23, 2022
bde990a
docs(configuration): mention default watchOptions.poll value (#6419)
chenxsan Sep 26, 2022
bbdd8bb
build(deps-dev): bump eslint from 8.23.1 to 8.24.0 (#6420)
dependabot[bot] Sep 27, 2022
f10a990
build(deps): bump react-spring from 9.5.4 to 9.5.5 (#6421)
dependabot[bot] Sep 27, 2022
af245f8
build(deps-dev): bump cypress from 10.8.0 to 10.9.0 (#6423)
dependabot[bot] Sep 28, 2022
9d46f0e
build(deps-dev): bump @babel/preset-env from 7.19.1 to 7.19.3 (#6424)
dependabot[bot] Sep 28, 2022
f71118f
build(deps-dev): bump @babel/core from 7.19.1 to 7.19.3 (#6425)
dependabot[bot] Sep 28, 2022
99724ef
build(deps-dev): bump css-minimizer-webpack-plugin from 4.1.0 to 4.2.…
dependabot[bot] Oct 1, 2022
e729946
build(deps-dev): bump jest from 29.0.3 to 29.1.2 (#6428)
dependabot[bot] Oct 1, 2022
d862d15
build(deps-dev): bump postcss from 8.4.16 to 8.4.17 (#6429)
dependabot[bot] Oct 1, 2022
7a820ae
build(deps-dev): bump @svgr/webpack from 6.3.1 to 6.4.0 (#6431)
dependabot[bot] Oct 4, 2022
6e78169
build(deps): bump react-router-dom from 6.4.1 to 6.4.2 (#6432)
dependabot[bot] Oct 7, 2022
39f5e66
build(deps-dev): bump css-minimizer-webpack-plugin from 4.2.0 to 4.2.…
dependabot[bot] Oct 7, 2022
d6a42c5
build(deps-dev): bump sass-loader from 13.0.2 to 13.1.0 (#6435)
dependabot[bot] Oct 8, 2022
e604104
docs(guides): mention limitation of Worker api (#6436)
chenxsan Oct 9, 2022
df2ab78
fix background color for inline code under dark mode (#6438)
chenxsan Oct 9, 2022
3dab627
CI: cancel previous runs for pull requests (#6437)
chenxsan Oct 10, 2022
0847079
CI: pin cancel workflow action version (#6440)
chenxsan Oct 10, 2022
3124f6c
build(deps-dev): bump @pmmmwh/react-refresh-webpack-plugin (#6442)
dependabot[bot] Oct 11, 2022
e902e27
build(deps-dev): bump @babel/preset-env from 7.19.3 to 7.19.4 (#6445)
dependabot[bot] Oct 11, 2022
e627888
build(deps-dev): bump eslint-plugin-react from 7.31.8 to 7.31.9 (#6443)
dependabot[bot] Oct 11, 2022
1028ce0
build(deps-dev): bump eslint from 8.24.0 to 8.25.0 (#6444)
dependabot[bot] Oct 11, 2022
98f254c
docs(configuration): update configuration page (#6441)
chenxsan Oct 11, 2022
86a9696
enable markdownlint for mdx (#6446)
chenxsan Oct 12, 2022
3bc80c4
build(deps-dev): bump eslint-plugin-react from 7.31.9 to 7.31.10 (#6448)
dependabot[bot] Oct 12, 2022
79e7947
build(deps-dev): bump cypress from 10.9.0 to 10.10.0 (#6449)
dependabot[bot] Oct 13, 2022
ff92f61
build(deps-dev): bump css-minimizer-webpack-plugin from 4.2.1 to 4.2.…
dependabot[bot] Oct 14, 2022
dcb3671
docs(configuration): Warn about module output being not usable in web…
jtomaszewski Oct 14, 2022
dce33bc
build(deps-dev): bump @octokit/auth-action from 2.0.1 to 2.0.2 (#6451)
dependabot[bot] Oct 14, 2022
12b725a
build(deps-dev): bump postcss from 8.4.17 to 8.4.18 (#6452)
dependabot[bot] Oct 14, 2022
1dbe1f6
add dependency review action (#6457)
chenxsan Oct 15, 2022
ed4c1a8
build(deps-dev): bump jest from 29.1.2 to 29.2.0 (#6455)
dependabot[bot] Oct 15, 2022
36118ca
build(deps-dev): bump @svgr/webpack from 6.4.0 to 6.5.0 (#6454)
dependabot[bot] Oct 15, 2022
25fb3a1
build(deps-dev): bump @octokit/rest from 19.0.4 to 19.0.5 (#6456)
dependabot[bot] Oct 15, 2022
63bb67f
docs(Configuration): fix lang for code block (#6458)
chenxsan Oct 16, 2022
8410a18
build(deps-dev): bump jest from 29.2.0 to 29.2.1 (#6460)
dependabot[bot] Oct 19, 2022
b19c946
docs: clean up .js-with-links (#6459)
chenxsan Oct 19, 2022
399a3c6
docs(Migration): `loaders` → `use` (#6373)
julienw Oct 19, 2022
53ad0f9
build(deps-dev): bump tailwindcss from 3.1.8 to 3.2.0 (#6461)
dependabot[bot] Oct 20, 2022
37954bb
upgrade tailwindcss configuration (#6462)
chenxsan Oct 21, 2022
447dd24
build(deps-dev): bump @babel/core from 7.19.3 to 7.19.6 (#6464)
dependabot[bot] Oct 21, 2022
0527e45
build(deps-dev): bump tailwindcss from 3.2.0 to 3.2.1 (#6465)
dependabot[bot] Oct 22, 2022
1e829c6
docs: update Node version note in CONTRIBUTING.md (#6466)
snitin315 Oct 22, 2022
c2ace33
build(deps-dev): bump eslint from 8.25.0 to 8.26.0 (#6467)
dependabot[bot] Oct 25, 2022
1ff7738
build(deps-dev): bump cypress from 10.10.0 to 10.11.0 (#6470)
dependabot[bot] Oct 26, 2022
50258a2
build(deps-dev): bump jest from 29.2.1 to 29.2.2 (#6471)
dependabot[bot] Oct 26, 2022
2b9fc4d
build(deps-dev): bump github-slugger from 1.4.0 to 1.5.0 (#6469)
dependabot[bot] Oct 26, 2022
7547bff
docs(en): merging all conflicts
docschina-bot Oct 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ will do this automatically. This step pulls in documentation for loaders/plugins
in separate repositories such as the ones found in the [webpack-contrib][4] organization.
See the `package.json` for the full list of `scripts`.

> Note that **Node 12.x** or above is required for the build process to run properly.
> **Note**
>
> **Node v14.20** or above is required for the build process to run properly.

## Contributor License Agreement

Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/cancel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Cancel
on:
workflow_run:
workflows: ["Ensure PR"]
types:
- requested
jobs:
cancel:
runs-on: ubuntu-latest
steps:
- uses: styfle/[email protected]
with:
workflow_id: ${{ github.event.workflow.id }}
14 changes: 14 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2
1 change: 1 addition & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
- name: Cypress run
uses: cypress-io/github-action@v4
with:
browser: chrome
config-file: cypress.config.js
build: yarn build
start: yarn serve-dist
Expand Down
6 changes: 5 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
"MD002": false,
"MD004": { "style": "dash" },
"MD007": { "indent": 2 },
"MD013": { "line_length": 600 },
"MD013": { "line_length": 600, "code_blocks": false },
"MD024": {
"siblings_only": true
},
"MD026": false,
"MD029": { "style": "ordered" },
"MD033": false,
"MD034": false,
"MD036": false,
"MD041": false,
"MD053": false,
"no-hard-tabs": false,
"whitespace": false
}
1 change: 1 addition & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
52 changes: 28 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"lint": "run-s lint:*",
"lint:js": "npm run lint-js .",
"lint-js": "eslint --cache --cache-location .cache/.eslintcache",
"lint:markdown": "npm run lint-markdown *.md",
"lint-markdown": "markdownlint --config ./.markdownlint.json --ignore '.vale/**/*.md' --ignore '.github/**/*.md'",
"lint:markdown": "npm run lint-markdown '**/*.{md,mdx}'",
"lint-markdown": "markdownlint --config ./.markdownlint.json",
"lint:prose": "vale --config='.vale.ini' src/content",
"lint:links": "hyperlink -c 8 --root dist -r dist/index.html --canonicalroot https://webpack.js.org/ --internal --skip /plugins/extract-text-webpack-plugin/ --skip /printable --skip https:// --skip http:// --skip sw.js > internal-links.tap; cat internal-links.tap | tap-spot",
"lint:heading": "textlint --fix src/content/*",
Expand All @@ -57,56 +57,60 @@
"printable": "node ./src/scripts/concatenate-docs.mjs",
"jest": "NODE_OPTIONS=--experimental-vm-modules jest --config=jest.config.mjs",
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"cypress:run": "cypress run --browser chrome",
"prettier": "prettier --write '**/*.{js,json,jsx,css,scss,md,mdx}'",
"prepare": "husky install && rimraf ./node_modules/.cache/webpack && yarn-deduplicate --strategy fewer"
},
"lint-staged": {
"*.{js,jsx,md,mdx}": [
"npm run lint-js"
],
"*.md": [
"*.{md,mdx}": [
"npm run lint-markdown"
],
"*.{js,jsx,css,scss,md,mdx,json}": [
"prettier --write"
]
},
"devDependencies": {
"@babel/core": "^7.19.1",
"@babel/core": "^7.19.6",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/preset-env": "^7.19.1",
"@babel/preset-env": "^7.19.4",
"@babel/preset-react": "^7.18.6",
"@mdx-js/loader": "^2.0.0-next.9",
"@octokit/auth-action": "^2.0.1",
"@octokit/rest": "^19.0.4",
"@octokit/auth-action": "^2.0.2",
"@octokit/rest": "^19.0.5",
"@pmmmwh/react-refresh-webpack-plugin": "next",
"@svgr/webpack": "^6.3.1",
"autoprefixer": "^10.4.11",
"@svgr/webpack": "^6.5.0",
"autoprefixer": "^10.4.12",
"babel-loader": "^8.2.5",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^4.1.0",
"cypress": "^10.7.0",
"css-minimizer-webpack-plugin": "^4.2.2",
"cypress": "^10.11.0",
"directory-tree": "^3.3.1",
"directory-tree-webpack-plugin": "^1.0.3",
"duplexer": "^0.1.1",
"eslint": "^8.23.1",
"eslint": "^8.26.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-mdx": "^2.0.4",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-mdx": "^2.0.5",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-react-hooks": "^4.6.0",
"front-matter": "^4.0.2",
<<<<<<< HEAD
"github-slugger": "^1.4.0",
"html-loader": "^2.1.2",
=======
"github-slugger": "^1.5.0",
>>>>>>> 2b9fc4d94dc9f4578acb169b21bc5fe5afffe834
"html-webpack-plugin": "^5.5.0",
"http-server": "^14.1.1",
"husky": "^8.0.1",
"hyperlink": "^5.0.4",
"jest": "^29.0.3",
"lightningcss": "^1.15.1",
"jest": "^29.2.2",
"lightningcss": "^1.16.0",
"lint-staged": "^13.0.3",
"lodash": "^4.17.21",
"markdownlint": "^0.26.2",
Expand All @@ -117,7 +121,7 @@
"modularscale-sass": "^3.0.3",
"node-fetch": "^3.2.10",
"npm-run-all": "^4.1.1",
"postcss": "^8.4.16",
"postcss": "^8.4.18",
"postcss-loader": "^7.0.1",
"prettier": "^2.7.1",
"react-refresh": "^0.14.0",
Expand All @@ -131,21 +135,21 @@
"remark-html": "^15.0.1",
"remark-refractor": "montogeek/remark-refractor",
"rimraf": "^3.0.2",
"sass": "^1.54.9",
"sass-loader": "^13.0.2",
"sass": "^1.55.0",
"sass-loader": "^13.1.0",
"sirv-cli": "^2.0.2",
"sitemap-static": "^0.4.2",
"static-site-generator-webpack-plugin": "^3.4.1",
"style-loader": "^3.3.1",
"tailwindcss": "^3.1.8",
"tailwindcss": "^3.2.1",
"tap-spot": "^1.1.2",
"textlint": "^11.8.2",
"textlint-rule-heading": "^1.0.10",
"unist-util-visit": "^4.1.1",
"webpack": "^5.74.0",
"webpack-bundle-analyzer": "^4.6.1",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.0",
"webpack-dev-server": "^4.11.1",
"webpack-merge": "^5.8.0",
"workbox-webpack-plugin": "^6.5.4",
"yarn-deduplicate": "^6.0.0"
Expand All @@ -157,8 +161,8 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-helmet-async": "^1.3.0",
"react-router-dom": "^6.4.0",
"react-spring": "^9.5.4",
"react-router-dom": "^6.4.2",
"react-spring": "^9.5.5",
"react-tiny-popover": "5",
"react-use": "^17.4.0",
"react-visibility-sensor": "^5.0.2",
Expand Down
88 changes: 0 additions & 88 deletions src/components/Configuration/Configuration.jsx

This file was deleted.

13 changes: 1 addition & 12 deletions src/components/Page/Page.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Import External Dependencies
import { Children, isValidElement, useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { useLocation } from 'react-router-dom';

Expand All @@ -9,7 +9,6 @@ import Markdown from '../Markdown/Markdown';
import Contributors from '../Contributors/Contributors';
import Translators from '../Translators/Translators';
import { PlaceholderString } from '../Placeholder/Placeholder';
import { Pre } from '../Configuration/Configuration';
import AdjacentPages from './AdjacentPages';

// Load Styling
Expand Down Expand Up @@ -95,16 +94,6 @@ export default function Page(props) {

if (typeof content === 'function') {
contentRender = content({}).props.children;
contentRender = Children.map(contentRender, (child) => {
if (isValidElement(child)) {
if (child.props.mdxType === 'pre') {
// eslint-disable-next-line
return <Pre children={child.props.children} />;
}
}

return child;
});
} else {
contentRender = (
<div
Expand Down
7 changes: 5 additions & 2 deletions src/content/api/loaders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ module.exports = function (source) {

这个模块将获取像下面的 bundle:

```
```text
/***/ "./src/loader.js!./src/lib.js":
/*!************************************!*\
!*** ./src/loader.js!./src/lib.js ***!
Expand Down Expand Up @@ -725,7 +725,10 @@ module.exports = function (source) {
if (STYLES_REGEXP.test(source)) {
source = source.replace(STYLES_REGEXP, '');
return `import ${JSON.stringify(
this.utils.contextify(this.context || this.rootContext, `${this.resource}.css!=!${getStylesLoader}!${this.remainingRequest}`)
this.utils.contextify(
this.context || this.rootContext,
`${this.resource}.css!=!${getStylesLoader}!${this.remainingRequest}`
)
)};${source}`;
}
return source;
Expand Down
11 changes: 11 additions & 0 deletions src/content/api/logging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,18 @@ module.exports = function (source) {
};
```

<<<<<<< HEAD
## Logger methods $#logger-methods$
=======
As you can see from the above `my-webpack-plugin.js` example, there're two types of logging methods,

1. `compilation.getLogger`
2. `compiler.getInfrastructureLogger`

It's advised to use `compilation.getLogger` when plugin/logging is related to the compilation, and they will be stored within the stats. For logging that happens outside the compilation cycle, use `compiler.getInfrastructureLogger` instead.

## Logger methods
>>>>>>> 2b9fc4d94dc9f4578acb169b21bc5fe5afffe834

- `logger.error(...)`:用于输出错误信息
- `logger.warn(...)`:用于输出警告信息
Expand Down
13 changes: 13 additions & 0 deletions src/content/api/module-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,14 @@ webpack 特定。[`module.hot`](#modulehot-webpack-specific) 的一个别名,[
) => webpack.Context;
```

<<<<<<< HEAD
- 可用版本:5.70.0+
- 示例:
=======
- Available: 5.70.0+
- Example:

>>>>>>> 2b9fc4d94dc9f4578acb169b21bc5fe5afffe834
```js
const contextRequire = import.meta.webpackContext('.', {
recursive: false,
Expand Down Expand Up @@ -286,9 +292,16 @@ if (__webpack_is_included__('./module-a.js')) {

运行时修改 base 的 URI。

<<<<<<< HEAD
- 类型:`string`
- 可用:5.21.0+
- 示例:
=======
- Type: `string`
- Available: 5.21.0+
- Example:

>>>>>>> 2b9fc4d94dc9f4578acb169b21bc5fe5afffe834
```js
__webpack_base_uri__ = 'https://example.com';
```
Expand Down
Loading