Skip to content

docs(en): merge webpack.js.org/master into webpack.js.org/cn @ 48a23c51 #1616

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

Merged
merged 30 commits into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3e4dcec
fix: improve highlighting for current subnav (#6240)
chenxsan Jun 26, 2022
089cfa2
docs(api): improve require docs (#6235)
vankop Jun 28, 2022
417412c
docs(concepts): fix typo in module-federation.mdx (#6242)
dimaaan21 Jun 28, 2022
4dc2268
build(deps-dev): bump sass-loader from 13.0.0 to 13.0.2 (#6243)
dependabot[bot] Jun 28, 2022
c70afd9
build(deps-dev): bump eslint-plugin-react from 7.30.0 to 7.30.1 (#6244)
dependabot[bot] Jun 28, 2022
61d01d9
build(deps-dev): bump lint-staged from 13.0.2 to 13.0.3 (#6245)
dependabot[bot] Jun 28, 2022
532418a
build(deps-dev): bump cypress from 10.2.0 to 10.3.0 (#6246)
dependabot[bot] Jun 29, 2022
a131225
build(deps-dev): bump @babel/preset-react from 7.17.12 to 7.18.6 (#6250)
dependabot[bot] Jun 29, 2022
4b9b604
build(deps-dev): bump @babel/core from 7.18.5 to 7.18.6 (#6247)
dependabot[bot] Jun 29, 2022
32d1566
build(deps-dev): bump @babel/preset-env from 7.18.2 to 7.18.6 (#6248)
dependabot[bot] Jun 29, 2022
a82e284
build(deps-dev): bump jest from 28.1.1 to 28.1.2 (#6251)
dependabot[bot] Jun 30, 2022
e13d86d
build(deps-dev): bump eslint-plugin-mdx from 2.0.0 to 2.0.1 (#6252)
dependabot[bot] Jul 1, 2022
e8c2f87
build(deps-dev): bump webpack-dev-server from 4.9.2 to 4.9.3 (#6253)
dependabot[bot] Jul 1, 2022
466badd
docs(configuration): add new type (#6225)
chenxsan Jul 2, 2022
f49efb6
drop node 12 (#6256)
chenxsan Jul 3, 2022
112ee14
docs: add `CycloneDX Webpack Plugin` (#6241)
jkowalleck Jul 3, 2022
f82e706
build(deps-dev): bump eslint from 8.18.0 to 8.19.0 (#6258)
dependabot[bot] Jul 5, 2022
58f3eb7
docs(api): document canMangle (#6257)
chenxsan Jul 6, 2022
513b8fd
build(deps-dev): bump tailwindcss from 3.1.4 to 3.1.5 (#6259)
dependabot[bot] Jul 8, 2022
e3a2560
build(deps-dev): bump @octokit/rest from 18.12.0 to 19.0.1 (#6260)
dependabot[bot] Jul 9, 2022
ec9bca6
build(deps-dev): bump @octokit/auth-action from 1.3.3 to 2.0.0 (#6261)
dependabot[bot] Jul 9, 2022
6e0e561
build(deps-dev): bump @parcel/css from 1.10.1 to 1.11.2 (#6263)
dependabot[bot] Jul 9, 2022
8547dec
fix(concepts): small grammatical edit (#6266)
mandel-sh Jul 12, 2022
9cf1539
build(deps-dev): bump postcss-loader from 7.0.0 to 7.0.1 (#6264)
dependabot[bot] Jul 12, 2022
af1c1ed
build(deps-dev): bump @octokit/rest from 19.0.1 to 19.0.3 (#6265)
dependabot[bot] Jul 12, 2022
f517f76
build(deps-dev): bump node-fetch from 3.2.6 to 3.2.8 (#6267)
dependabot[bot] Jul 12, 2022
48a23c5
build(deps-dev): bump tailwindcss from 3.1.5 to 3.1.6 (#6268)
dependabot[bot] Jul 13, 2022
60ae9f3
docs(en): merging all conflicts
docschina-bot Jul 13, 2022
87082fd
docs(en): fix conflicts
jacob-lcs Jul 14, 2022
4fffc91
docs(en): fix conflicts
jacob-lcs Jul 14, 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
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"url": "https://github.com/webpack/webpack.js.org/issues"
},
"engines": {
"node": ">=12"
"node": ">=14"
},
"scripts": {
"clean-dist": "rimraf ./dist",
Expand Down Expand Up @@ -73,31 +73,31 @@
]
},
"devDependencies": {
"@babel/core": "^7.18.5",
"@babel/core": "^7.18.6",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-env": "^7.18.6",
"@babel/preset-react": "^7.18.6",
"@mdx-js/loader": "^2.0.0-next.9",
"@octokit/auth-action": "^1.3.3",
"@octokit/rest": "^18.12.0",
"@parcel/css": "^1.10.1",
"@octokit/auth-action": "^2.0.0",
"@octokit/rest": "^19.0.3",
"@parcel/css": "^1.11.2",
"@pmmmwh/react-refresh-webpack-plugin": "next",
"@svgr/webpack": "^6.2.1",
"autoprefixer": "^10.4.7",
"babel-loader": "^8.2.5",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^4.0.0",
"cypress": "^10.2.0",
"cypress": "^10.3.0",
"directory-tree": "^3.3.0",
"directory-tree-webpack-plugin": "^1.0.3",
"duplexer": "^0.1.1",
"eslint": "^8.18.0",
"eslint": "^8.19.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-mdx": "^2.0.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-mdx": "^2.0.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"front-matter": "^4.0.2",
"github-slugger": "^1.4.0",
Expand All @@ -106,19 +106,19 @@
"http-server": "^14.1.1",
"husky": "^8.0.1",
"hyperlink": "^5.0.4",
"jest": "^28.1.1",
"lint-staged": "^13.0.2",
"jest": "^28.1.2",
"lint-staged": "^13.0.3",
"lodash": "^4.17.21",
"markdownlint": "^0.26.0",
"markdownlint-cli": "^0.31.1",
"mdast-util-to-string": "^3.1.0",
"mini-css-extract-plugin": "^2.6.1",
"mkdirp": "^1.0.4",
"modularscale-sass": "^3.0.3",
"node-fetch": "^3.2.6",
"node-fetch": "^3.2.8",
"npm-run-all": "^4.1.1",
"postcss": "^8.4.14",
"postcss-loader": "^7.0.0",
"postcss-loader": "^7.0.1",
"prettier": "^2.7.1",
"react-refresh": "^0.14.0",
"redirect-webpack-plugin": "^1.0.0",
Expand All @@ -132,20 +132,20 @@
"remark-refractor": "montogeek/remark-refractor",
"rimraf": "^3.0.2",
"sass": "^1.53.0",
"sass-loader": "^13.0.0",
"sass-loader": "^13.0.2",
"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.4",
"tailwindcss": "^3.1.6",
"tap-spot": "^1.1.2",
"textlint": "^11.8.2",
"textlint-rule-heading": "^1.0.10",
"unist-util-visit": "^4.1.0",
"webpack": "^5.73.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2",
"webpack-dev-server": "^4.9.3",
"webpack-merge": "^5.8.0",
"workbox-webpack-plugin": "^6.5.3"
},
Expand Down
3 changes: 2 additions & 1 deletion src/components/Navigation/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,13 @@ function Navigation({ links, pathname, hash = '', toggleSidebar }) {
{link.children.map((child) => {
const classNames =
'text-blue-400 py-5 text-sm capitalize hover:text-black dark:hover:text-white';
const isActive = location.pathname.startsWith(child.url);
return (
<NavLink
key={child.url}
to={child.url}
title={child.title}
className={({ isActive }) =>
className={() =>
isActive
? `!text-black dark:!text-white ${classNames}`
: classNames
Expand Down
12 changes: 12 additions & 0 deletions src/content/api/module-methods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -436,3 +436,15 @@ __webpack_modules__[require.resolveWeak(`./page/${page}`)];
```

T> `require.resolveWeak` 是_通用渲染_(服务器端渲染 SSR + 代码分割 Code Splitting)的基础。例如在 [react-universal-component](https://github.com/faceyspacey/react-universal-component) 等包中的用法。它允许代码在服务器端和客户端初始页面的加载上同步渲染。它要求手动或以某种方式提供 chunk。它可以在不需要指示应该被打包的情况下引入模块。它与 `import()` 一起使用,当用户导航触发额外的导入时,它会被接管。

### warning

如果模块源码包含无法静态分析的 require,则会发出关键依赖项警告。

示例代码:

```javascript
someFn(require);
require.bind(null);
require(variable);
```
2 changes: 2 additions & 0 deletions src/content/api/module-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ __webpack_get_script_filename__ = (chunkId) => {

- 可以从嵌套的 exports 中得到相关信息: 例如 `__webpack_exports_info__.<exportName>.<exportName>.<exportName>.used`

- Check whether exports can be mangled with `__webpack_exports_info__.<name>.canMangle`

## \_\_webpack_is_included\_\_ (webpack-specific)

<Badge text="5.16.0+" />
Expand Down
1 change: 1 addition & 0 deletions src/content/awesome-webpack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ _People passionate about Webpack (In no particular order)_
- [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)
- [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)
- [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)
- [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)

### Webpack Tools

Expand Down
2 changes: 1 addition & 1 deletion src/content/concepts/module-federation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export function set(value) {
const publicPath = await import('remote/public-path');
publicPath.set('/your-public-path');

//boostrap app e.g. import('./boostrap.js')
//bootstrap app e.g. import('./bootstrap.js')
```

### Infer publicPath from script $#inferpublicpathfromscript$
Expand Down
10 changes: 8 additions & 2 deletions src/content/configuration/other-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -437,16 +437,22 @@ module.exports = {

### immutablePaths $#immutable-paths$

`[string]`
`(RegExp | string)[]`

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

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

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

`[string]`
### managedPaths

`(RegExp | string)[]`

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

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

### module $#module$

Expand Down
Loading