Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bb155ac

Browse filesBrowse files
committed
docs(en): merging all conflicts
2 parents f8e9bfa + 2eb6c6a commit bb155ac
Copy full SHA for bb155ac
Expand file treeCollapse file tree

34 files changed

+1410
-841
lines changed

‎.github/workflows/deploy.yml

Copy file name to clipboardExpand all lines: .github/workflows/deploy.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
node-version: [16.x]
1616
runs-on: ${{ matrix.os }}
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919

2020
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v2
21+
uses: actions/setup-node@v3
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424
cache: yarn
@@ -31,7 +31,7 @@ jobs:
3131
- run: yarn lint:links
3232

3333
- name: Deploy
34-
uses: JamesIves/github-pages-deploy-action@4.1.8
34+
uses: JamesIves/github-pages-deploy-action@v4.2.5
3535
with:
3636
token: ${{ secrets.GITHUB_TOKEN }}
3737
branch: gh-pages

‎.github/workflows/testing.yml

Copy file name to clipboardExpand all lines: .github/workflows/testing.yml
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
node-version: [16.x]
1313
runs-on: ${{ matrix.os }}
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616

1717
- name: Use Node.js ${{ matrix.node-version }}
18-
uses: actions/setup-node@v2
18+
uses: actions/setup-node@v3
1919
with:
2020
node-version: ${{ matrix.node-version }}
2121
cache: yarn
@@ -31,7 +31,7 @@ jobs:
3131
os: [ubuntu-latest]
3232
runs-on: ${{ matrix.os }}
3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v3
3535

3636
- name: Vale
3737
uses: errata-ai/vale-action@v1.4.2
@@ -48,10 +48,10 @@ jobs:
4848
node-version: [16.x]
4949
runs-on: ${{ matrix.os }}
5050
steps:
51-
- uses: actions/checkout@v2
51+
- uses: actions/checkout@v3
5252

5353
- name: Use Node.js ${{ matrix.node-version }}
54-
uses: actions/setup-node@v2
54+
uses: actions/setup-node@v3
5555
with:
5656
node-version: ${{ matrix.node-version }}
5757
cache: yarn
@@ -72,10 +72,10 @@ jobs:
7272
node-version: [16.x]
7373
runs-on: ${{ matrix.os }}
7474
steps:
75-
- uses: actions/checkout@v2
75+
- uses: actions/checkout@v3
7676

7777
- name: Use Node.js ${{ matrix.node-version }}
78-
uses: actions/setup-node@v2
78+
uses: actions/setup-node@v3
7979
with:
8080
node-version: ${{ matrix.node-version }}
8181
cache: yarn

‎package.json

Copy file name to clipboardExpand all lines: package.json
+37-27Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -73,53 +73,64 @@
7373
]
7474
},
7575
"devDependencies": {
76-
"@babel/core": "^7.17.0",
76+
"@babel/core": "^7.17.8",
7777
"@babel/eslint-parser": "^7.17.0",
7878
"@babel/plugin-proposal-class-properties": "^7.16.7",
7979
"@babel/preset-env": "^7.16.11",
8080
"@babel/preset-react": "^7.16.7",
8181
"@mdx-js/loader": "^2.0.0-next.9",
8282
"@octokit/auth-action": "^1.3.3",
8383
"@octokit/rest": "^18.12.0",
84+
"@parcel/css": "^1.7.4",
8485
"@pmmmwh/react-refresh-webpack-plugin": "next",
8586
"@svgr/webpack": "^6.2.1",
86-
"autoprefixer": "^10.4.2",
87-
"babel-loader": "^8.2.3",
87+
"autoprefixer": "^10.4.4",
88+
"babel-loader": "^8.2.4",
8889
"copy-webpack-plugin": "^10.2.4",
89-
"css-loader": "^6.6.0",
90+
"css-loader": "^6.7.1",
9091
"css-minimizer-webpack-plugin": "^3.4.1",
91-
"cypress": "^9.4.1",
92-
"directory-tree": "^3.1.0",
92+
"cypress": "^9.5.3",
93+
"directory-tree": "^3.2.2",
9394
"directory-tree-webpack-plugin": "^1.0.3",
9495
"duplexer": "^0.1.1",
95-
"eslint": "^8.8.0",
96-
"eslint-config-prettier": "^8.3.0",
96+
"eslint": "^8.12.0",
97+
"eslint-config-prettier": "^8.5.0",
9798
"eslint-plugin-cypress": "^2.12.1",
98-
"eslint-plugin-mdx": "^1.16.0",
99-
"eslint-plugin-react": "^7.28.0",
100-
"eslint-plugin-react-hooks": "^4.3.0",
99+
"eslint-plugin-mdx": "^1.17.0",
100+
"eslint-plugin-react": "^7.29.4",
101+
"eslint-plugin-react-hooks": "^4.4.0",
101102
"front-matter": "^4.0.2",
103+
<<<<<<< HEAD
102104
"github-slugger": "^1.3.0",
103105
"html-loader": "^2.1.2",
106+
=======
107+
"github-slugger": "^1.4.0",
108+
>>>>>>> 2eb6c6adc5157680cd9e38aa7767c3e5fee78e76
104109
"html-webpack-plugin": "^5.5.0",
105110
"http-server": "^14.1.0",
106111
"husky": "^7.0.4",
107112
"hyperlink": "^5.0.4",
108-
"jest": "^27.5.0",
109-
"lint-staged": "^12.3.3",
113+
"jest": "^27.5.1",
114+
"lint-staged": "^12.3.7",
110115
"lodash": "^4.17.21",
111116
"markdownlint": "^0.25.1",
117+
<<<<<<< HEAD
112118
"markdownlint-cli": "^0.31.0",
113119
"mdast-util-to-string": "^1.1.0",
114120
"mini-css-extract-plugin": "^2.5.3",
121+
=======
122+
"markdownlint-cli": "^0.31.1",
123+
"mdast-util-to-string": "^3.1.0",
124+
"mini-css-extract-plugin": "^2.6.0",
125+
>>>>>>> 2eb6c6adc5157680cd9e38aa7767c3e5fee78e76
115126
"mkdirp": "^1.0.4",
116127
"modularscale-sass": "^3.0.3",
117-
"node-fetch": "^3.2.0",
128+
"node-fetch": "^3.2.3",
118129
"npm-run-all": "^4.1.1",
119-
"postcss": "^8.4.6",
130+
"postcss": "^8.4.12",
120131
"postcss-loader": "^6.2.1",
121-
"prettier": "^2.5.1",
122-
"react-refresh": "^0.11.0",
132+
"prettier": "^2.6.1",
133+
"react-refresh": "^0.12.0",
123134
"redirect-webpack-plugin": "^1.0.0",
124135
"remark": "^14.0.2",
125136
"remark-autolink-headings": "7.0.1",
@@ -129,42 +140,41 @@
129140
"remark-gfm": "^1.0.0",
130141
"remark-html": "^15.0.1",
131142
"remark-refractor": "montogeek/remark-refractor",
132-
"remark-slug": "^7.0.1",
133143
"rimraf": "^3.0.2",
134-
"sass": "^1.49.7",
135-
"sass-loader": "^12.4.0",
144+
"sass": "^1.49.10",
145+
"sass-loader": "^12.6.0",
136146
"sirv-cli": "^2.0.2",
137147
"sitemap-static": "^0.4.2",
138148
"start-server-and-test": "^1.14.0",
139149
"static-site-generator-webpack-plugin": "^3.4.1",
140150
"style-loader": "^3.3.1",
141-
"tailwindcss": "^3.0.18",
151+
"tailwindcss": "^3.0.23",
142152
"tap-spot": "^1.1.1",
143153
"textlint": "^11.8.2",
144154
"textlint-rule-heading": "^1.0.10",
145155
"unist-util-visit": "^4.1.0",
146-
"webpack": "^5.68.0",
156+
"webpack": "^5.71.0",
147157
"webpack-bundle-analyzer": "^4.5.0",
148158
"webpack-cli": "^4.9.2",
149159
"webpack-dev-server": "^4.7.4",
150160
"webpack-merge": "^5.8.0",
151-
"workbox-webpack-plugin": "^6.4.2"
161+
"workbox-webpack-plugin": "^6.5.2"
152162
},
153163
"dependencies": {
154164
"@docsearch/react": "^3.0.0-alpha.50",
155165
"path-browserify": "^1.0.1",
156166
"prop-types": "^15.8.1",
157167
"react": "^17.0.2",
158168
"react-dom": "^17.0.2",
159-
"react-helmet-async": "^1.2.2",
160-
"react-router-dom": "^6.2.1",
161-
"react-spring": "^9.4.2",
169+
"react-helmet-async": "^1.2.3",
170+
"react-router-dom": "^6.3.0",
171+
"react-spring": "^9.4.4",
162172
"react-tiny-popover": "5",
163173
"react-use": "^17.3.2",
164174
"react-visibility-sensor": "^5.0.2",
165175
"webpack-pwa-manifest": "^4.3.0",
166176
"webpack.vote": "https://github.com/webpack/voting-app.git",
167-
"workbox-window": "^6.4.2"
177+
"workbox-window": "^6.5.2"
168178
},
169179
"resolutions": {
170180
"sitemap-static/minimist": "1.2.5",

‎src/components/Markdown/Markdown.scss

Copy file name to clipboardExpand all lines: src/components/Markdown/Markdown.scss
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use "sass:color";
1+
@use 'sass:color';
22
@import 'vars';
33
@import 'functions';
44
@import 'prism-theme';
@@ -41,15 +41,16 @@ $topHeightMobileWithBanner: $bannerHeight + $topHeightMobile;
4141
h4,
4242
h5,
4343
h6 {
44-
&:before {
45-
content: '';
44+
> span[id] {
45+
position: absolute;
46+
width: 0;
4647
display: block;
4748
visibility: hidden;
4849
pointer-events: none;
49-
height: $topHeightMobile;
50+
padding-top: $topHeightMobile;
5051
margin-top: -#{$topHeightMobile};
5152
@include break {
52-
height: $topHeightDesktop;
53+
padding-top: $topHeightDesktop;
5354
margin-top: -#{$topHeightDesktop};
5455
}
5556
}

‎src/components/Page/Page.jsx

Copy file name to clipboardExpand all lines: src/components/Page/Page.jsx
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ export default function Page(props) {
9797
<Markdown>
9898
<h1>{title}</h1>
9999

100+
{rest.thirdParty ? (
101+
<div className="italic my-[20px]">
102+
<strong className="font-bold">Disclaimer:</strong> {title} is a
103+
third-party package maintained by community members, it potentially
104+
does not have the same support, security policy or license as
105+
webpack, and it is not maintained by webpack.
106+
</div>
107+
) : null}
108+
100109
{contentRender}
101110

102111
{loadRelated && (

‎src/components/Site/Site.jsx

Copy file name to clipboardExpand all lines: src/components/Site/Site.jsx
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,16 @@ function Site(props) {
268268
)
269269
),
270270
},
271+
<<<<<<< HEAD
271272
{ content: '参与贡献', url: '/contribute/' },
272273
{ content: '投票', url: 'https://v4.webpack.docschina.org/vote/' },
273274
{ content: '博客', url: '/blog/' },
274275
{ content: '印记中文', url: 'https://docschina.org' },
276+
=======
277+
{ content: 'Contribute', url: '/contribute/' },
278+
{ content: 'Vote', url: '/vote/' },
279+
{ content: 'Blog', url: '/blog/' },
280+
>>>>>>> 2eb6c6adc5157680cd9e38aa7767c3e5fee78e76
275281
]}
276282
/>
277283
</div>

‎src/components/Support/Support.jsx

Copy file name to clipboardExpand all lines: src/components/Support/Support.jsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function formatMoney(number) {
8585
let str = Math.round(number) + '';
8686

8787
if (str.length > 3) {
88-
str = str.substr(0, str.length - 3) + ',' + str.substr(-3);
88+
str = str.slice(0, -3) + ',' + str.slice(-3);
8989
}
9090
return str;
9191
}

‎src/content/api/cli.mdx

Copy file name to clipboardExpand all lines: src/content/api/cli.mdx
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ npx webpack init ./my-app --force --template=default
101101

102102
`boolean`
103103

104+
<<<<<<< HEAD
104105
生成项目时不启用选项模式。当为 `true` 时,所有命令行选项使用默认值。
106+
=======
107+
To generate a project without questions. When enabled, the default answer for each question will be used.
108+
>>>>>>> 2eb6c6adc5157680cd9e38aa7767c3e5fee78e76
105109

106110
T> 点击 [这里](https://github.com/webpack/webpack-cli/blob/master/packages/generators/INIT.md) 获取 `webpack init` 命令的完整文档。
107111

@@ -581,11 +585,19 @@ T> 请查阅 [environment 变量指南](/guides/environment-variables/)了解更
581585

582586
除了上面所说的自定义 `env` 变量,在你的 webpack 配置中也使用了一些 `env` 内置变量:
583587

588+
<<<<<<< HEAD
584589
| 变量名 | 描述 |
585590
| --------------- | --------------------------------------------- |
586591
| `WEBPACK_SERVE` | 如果使用了 `serve\|s`,则为 `true`。 |
587592
| `WEBPACK_BUILD` | 如果使用了 `build\|bundle\|b`,则为 `true`。 |
588593
| `WEBPACK_WATCH` | 如果使用了 `--watch\|watch\|w`,则为 `true`。 |
594+
=======
595+
| Environment Variable | Description |
596+
| -------------------- | -------------------------------------------- |
597+
| `WEBPACK_SERVE` | `true` if `serve\|server\|s` is being used. |
598+
| `WEBPACK_BUILD` | `true` if `build\|bundle\|b` is being used. |
599+
| `WEBPACK_WATCH` | `true` if `--watch\|watch\|w` is being used. |
600+
>>>>>>> 2eb6c6adc5157680cd9e38aa7767c3e5fee78e76
589601

590602
请注意你不能在 bundle 代码中使用这些内置环境变量。
591603

‎src/content/api/compilation-object.mdx

Copy file name to clipboardExpand all lines: src/content/api/compilation-object.mdx
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,15 @@ Compilation 对象有很多可用的方法和钩子。在此页面,我们将
229229
- `block` - `Chunk` 的块连接。
230230
- `chunk` - 从依赖中删除的块。
231231

232+
<<<<<<< HEAD
232233
### sortItemsWithModuleIds $#sortitemswithmoduleids$
233234

234235
`function`
235236

236237
### sortItemsWithChunkIds $#sortitemswithchunkids$
238+
=======
239+
### sortItemsWithChunkIds
240+
>>>>>>> 2eb6c6adc5157680cd9e38aa7767c3e5fee78e76
237241

238242
`function`
239243

‎src/content/api/module-variables.mdx

Copy file name to clipboardExpand all lines: src/content/api/module-variables.mdx
+38Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,45 @@ console.log(import.meta.webpack); // output `5` for webpack 5
109109
110110
webpack 特定。[`module.hot`](#modulehot-webpack-specific) 的一个别名,[strict ESM](/guides/ecma-script-modules/#flagging-modules-as-esm) 中可以使用 `import.meta.webpackHot` 但是不能使用 `module.hot`
111111
112+
<<<<<<< HEAD
112113
## \_\_filename (NodeJS) $#__filename-nodejs$
114+
=======
115+
## import.meta.webpackContext
116+
117+
Returns the same value as `require.context` but only for `javascript/auto` and `javascript/esm`.
118+
119+
- Type:
120+
121+
```ts
122+
(
123+
request: string,
124+
options?: {
125+
recursive?: boolean;
126+
regExp?: RegExp;
127+
include?: RegExp;
128+
exclude?: RegExp;
129+
preload?: boolean | number;
130+
prefetch?: boolean | number;
131+
chunkName?: string;
132+
exports?: string | string[][];
133+
mode?: 'sync' | 'eager' | 'weak' | 'lazy' | 'lazy-once';
134+
}
135+
) => webpack.Context;
136+
```
137+
138+
- Available: 5.70.0+
139+
- Example:
140+
```js
141+
const contextRequire = import.meta.webpackContext('.', {
142+
recursive: false,
143+
regExp: /two/,
144+
mode: 'weak',
145+
exclude: /three/,
146+
});
147+
```
148+
149+
## \_\_filename (NodeJS)
150+
>>>>>>> 2eb6c6adc5157680cd9e38aa7767c3e5fee78e76
113151
114152
取决于 `node.__filename` 配置选项:
115153

‎src/content/configuration/dev-server.mdx

Copy file name to clipboardExpand all lines: src/content/configuration/dev-server.mdx
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,11 @@ npx webpack serve --port auto
12771277

12781278
当拥有单独的 API 后端开发服务器并且希望在同一域上发送 API 请求时,代理某些 URL 可能会很有用。
12791279

1280+
<<<<<<< HEAD
12801281
开发服务器使用功能强大的 [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) 软件包。 查看其 [documentation](https://github.com/chimurai/http-proxy-middleware#options) 了解更多高级用法。 请注意,`http-proxy-middleware` 的某些功能不需要`target`键,例如 它的 `router` 功能,但是仍然需要在此处的配置中包含`target`,否则`webpack-dev-server` 不会将其传递给 `http-proxy-middleware`)。
1282+
=======
1283+
The dev-server makes use of the powerful [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) package. Check out its [documentation](https://github.com/chimurai/http-proxy-middleware#options) for more advanced usages. Note that some of `http-proxy-middleware`'s features do not require a `target` key, e.g. its `router` feature, but you will still need to include a `target` key in your configuration here, otherwise `webpack-dev-server` won't pass it along to `http-proxy-middleware`.
1284+
>>>>>>> 2eb6c6adc5157680cd9e38aa7767c3e5fee78e76
12811285

12821286
使用后端在 `localhost:3000` 上,可以使用它来启用代理:
12831287

‎src/content/configuration/experiments.mdx

Copy file name to clipboardExpand all lines: src/content/configuration/experiments.mdx
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,19 @@ Define the location to store the lockfile.
167167

168168
By default webpack would generate a `<compiler-name.>webpack.lock` file>. Make sure to commit it into a version control system. During the `production` build, webpack will build those modules beginning with `http(s):` protocol from the lockfile and caches under [`experiments.buildHttp.cacheLocation`](#experimentsbuildhttpcachelocation).
169169

170+
<<<<<<< HEAD
170171
#### experiments.buildHttp.upgrade $#experimentsbuildhttpupgrade$
172+
=======
173+
#### experiments.buildHttp.proxy
174+
175+
Specify the proxy server to use for fetching remote resources.
176+
177+
- Type: `string`
178+
179+
By default, Webpack would imply the proxy server to use for fetching remote resources from the `http_proxy` (case insensitive) environment variable. However, you can also specify one through the `proxy` option.
180+
181+
#### experiments.buildHttp.upgrade
182+
>>>>>>> 2eb6c6adc5157680cd9e38aa7767c3e5fee78e76
171183

172184
Detect changes to remote resources and upgrade them automatically.
173185

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.