Skip to content

Commit 952c96a

Browse files
authored
Merge pull request #1616 from docschina/sync-48a23c51
docs(en): merge webpack.js.org/master into webpack.js.org/cn @ 48a23c5
2 parents 190c769 + 4fffc91 commit 952c96a

File tree

8 files changed

+1060
-1038
lines changed

8 files changed

+1060
-1038
lines changed

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"url": "https://github.com/webpack/webpack.js.org/issues"
2222
},
2323
"engines": {
24-
"node": ">=12"
24+
"node": ">=14"
2525
},
2626
"scripts": {
2727
"clean-dist": "rimraf ./dist",
@@ -73,31 +73,31 @@
7373
]
7474
},
7575
"devDependencies": {
76-
"@babel/core": "^7.18.5",
76+
"@babel/core": "^7.18.6",
7777
"@babel/eslint-parser": "^7.18.2",
7878
"@babel/plugin-proposal-class-properties": "^7.17.12",
79-
"@babel/preset-env": "^7.18.2",
80-
"@babel/preset-react": "^7.17.12",
79+
"@babel/preset-env": "^7.18.6",
80+
"@babel/preset-react": "^7.18.6",
8181
"@mdx-js/loader": "^2.0.0-next.9",
82-
"@octokit/auth-action": "^1.3.3",
83-
"@octokit/rest": "^18.12.0",
84-
"@parcel/css": "^1.10.1",
82+
"@octokit/auth-action": "^2.0.0",
83+
"@octokit/rest": "^19.0.3",
84+
"@parcel/css": "^1.11.2",
8585
"@pmmmwh/react-refresh-webpack-plugin": "next",
8686
"@svgr/webpack": "^6.2.1",
8787
"autoprefixer": "^10.4.7",
8888
"babel-loader": "^8.2.5",
8989
"copy-webpack-plugin": "^11.0.0",
9090
"css-loader": "^6.7.1",
9191
"css-minimizer-webpack-plugin": "^4.0.0",
92-
"cypress": "^10.2.0",
92+
"cypress": "^10.3.0",
9393
"directory-tree": "^3.3.0",
9494
"directory-tree-webpack-plugin": "^1.0.3",
9595
"duplexer": "^0.1.1",
96-
"eslint": "^8.18.0",
96+
"eslint": "^8.19.0",
9797
"eslint-config-prettier": "^8.5.0",
9898
"eslint-plugin-cypress": "^2.12.1",
99-
"eslint-plugin-mdx": "^2.0.0",
100-
"eslint-plugin-react": "^7.30.0",
99+
"eslint-plugin-mdx": "^2.0.1",
100+
"eslint-plugin-react": "^7.30.1",
101101
"eslint-plugin-react-hooks": "^4.6.0",
102102
"front-matter": "^4.0.2",
103103
"github-slugger": "^1.4.0",
@@ -106,19 +106,19 @@
106106
"http-server": "^14.1.1",
107107
"husky": "^8.0.1",
108108
"hyperlink": "^5.0.4",
109-
"jest": "^28.1.1",
110-
"lint-staged": "^13.0.2",
109+
"jest": "^28.1.2",
110+
"lint-staged": "^13.0.3",
111111
"lodash": "^4.17.21",
112112
"markdownlint": "^0.26.0",
113113
"markdownlint-cli": "^0.31.1",
114114
"mdast-util-to-string": "^3.1.0",
115115
"mini-css-extract-plugin": "^2.6.1",
116116
"mkdirp": "^1.0.4",
117117
"modularscale-sass": "^3.0.3",
118-
"node-fetch": "^3.2.6",
118+
"node-fetch": "^3.2.8",
119119
"npm-run-all": "^4.1.1",
120120
"postcss": "^8.4.14",
121-
"postcss-loader": "^7.0.0",
121+
"postcss-loader": "^7.0.1",
122122
"prettier": "^2.7.1",
123123
"react-refresh": "^0.14.0",
124124
"redirect-webpack-plugin": "^1.0.0",
@@ -132,20 +132,20 @@
132132
"remark-refractor": "montogeek/remark-refractor",
133133
"rimraf": "^3.0.2",
134134
"sass": "^1.53.0",
135-
"sass-loader": "^13.0.0",
135+
"sass-loader": "^13.0.2",
136136
"sirv-cli": "^2.0.2",
137137
"sitemap-static": "^0.4.2",
138138
"static-site-generator-webpack-plugin": "^3.4.1",
139139
"style-loader": "^3.3.1",
140-
"tailwindcss": "^3.1.4",
140+
"tailwindcss": "^3.1.6",
141141
"tap-spot": "^1.1.2",
142142
"textlint": "^11.8.2",
143143
"textlint-rule-heading": "^1.0.10",
144144
"unist-util-visit": "^4.1.0",
145145
"webpack": "^5.73.0",
146146
"webpack-bundle-analyzer": "^4.5.0",
147147
"webpack-cli": "^4.10.0",
148-
"webpack-dev-server": "^4.9.2",
148+
"webpack-dev-server": "^4.9.3",
149149
"webpack-merge": "^5.8.0",
150150
"workbox-webpack-plugin": "^6.5.3"
151151
},

src/components/Navigation/Navigation.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,13 @@ function Navigation({ links, pathname, hash = '', toggleSidebar }) {
212212
{link.children.map((child) => {
213213
const classNames =
214214
'text-blue-400 py-5 text-sm capitalize hover:text-black dark:hover:text-white';
215+
const isActive = location.pathname.startsWith(child.url);
215216
return (
216217
<NavLink
217218
key={child.url}
218219
to={child.url}
219220
title={child.title}
220-
className={({ isActive }) =>
221+
className={() =>
221222
isActive
222223
? `!text-black dark:!text-white ${classNames}`
223224
: classNames

src/content/api/module-methods.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,3 +436,15 @@ __webpack_modules__[require.resolveWeak(`./page/${page}`)];
436436
```
437437

438438
T> `require.resolveWeak`_通用渲染_(服务器端渲染 SSR + 代码分割 Code Splitting)的基础。例如在 [react-universal-component](https://github.com/faceyspacey/react-universal-component) 等包中的用法。它允许代码在服务器端和客户端初始页面的加载上同步渲染。它要求手动或以某种方式提供 chunk。它可以在不需要指示应该被打包的情况下引入模块。它与 `import()` 一起使用,当用户导航触发额外的导入时,它会被接管。
439+
440+
### warning
441+
442+
如果模块源码包含无法静态分析的 require,则会发出关键依赖项警告。
443+
444+
示例代码:
445+
446+
```javascript
447+
someFn(require);
448+
require.bind(null);
449+
require(variable);
450+
```

src/content/api/module-variables.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ __webpack_get_script_filename__ = (chunkId) => {
268268
269269
- 可以从嵌套的 exports 中得到相关信息: 例如 `__webpack_exports_info__.<exportName>.<exportName>.<exportName>.used`
270270
271+
- Check whether exports can be mangled with `__webpack_exports_info__.<name>.canMangle`
272+
271273
## \_\_webpack_is_included\_\_ (webpack-specific)
272274
273275
<Badge text="5.16.0+" />

src/content/awesome-webpack.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ _People passionate about Webpack (In no particular order)_
171171
- [Chrome Extension Archive Webpack Plugin](https://github.com/KeisukeYamashita/chrome-extension-archive-webpack-plugin) Create archive file to publish Chrome Exentions to Chrome Web Store -- _Maintainer_: `KeisukeYamashita` [![Github][githubicon]](https://github.com/KeisukeYamashita)
172172
- [Layer-pack Webpack Plugin](https://github.com/layer-pack/layer-pack) Allow to glob imports file & directories, build mono repo apps via inheritable source code / npm packages & share webpack configs -- _Maintainer_: `Braun Nathanaël` [![Github][githubicon]](https://github.com/N8tz)
173173
- [webpack-typescript-directory-compile-plugin](https://github.com/ssigwart/webpack-typescript-directory-compile-plugin) Configure an source directory of typescript files and an output directory for JavaScript files. Each typescript file in the source directory and any newly added files will be compiled to individual JavaScript files. -- _Maintainer_: `Stephen Sigwart` [![Github][githubicon]](https://github.com/ssigwart)
174+
- [CycloneDX Webpack Plugin](https://github.com/CycloneDX/cyclonedx-webpack-plugin#readme): Create CycloneDX Software Bill of Materials (SBOM) from webpack bundles at compile time. -- _Maintainer_: `OWASP CycloneDX Team` [![Github][githubicon]](https://github.com/CycloneDX)
174175

175176
### Webpack Tools
176177

src/content/concepts/module-federation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export function set(value) {
259259
const publicPath = await import('remote/public-path');
260260
publicPath.set('/your-public-path');
261261

262-
//boostrap app e.g. import('./boostrap.js')
262+
//bootstrap app e.g. import('./bootstrap.js')
263263
```
264264

265265
### Infer publicPath from script $#inferpublicpathfromscript$

src/content/configuration/other-options.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,16 +437,22 @@ module.exports = {
437437

438438
### immutablePaths $#immutable-paths$
439439

440-
`[string]`
440+
`(RegExp | string)[]`
441441

442442
由包管理器管理的路径数组,在其路径中包含一个版本或哈希,以便所有文件都是不可变的(immutable)。
443443

444+
如果使用正则表达式,请确保将路径包裹在捕获组中。
445+
444446
### managedPaths $#managedpaths$
447+
如果使用正则表达式,请确保将路径包裹在捕获组中。
445448

446-
`[string]`
449+
### managedPaths
450+
451+
`(RegExp | string)[]`
447452

448453
由包管理器管理的路径数组,可以信任它不会被修改。
449454

455+
如果使用正则表达式,请确保将路径包裹在捕获组中。
450456

451457
### module $#module$
452458

0 commit comments

Comments
 (0)