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 @ f82e706f #1610

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 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
119ef72
docs(en): merging all conflicts
docschina-bot Jul 5, 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
24 changes: 12 additions & 12 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,11 +73,11 @@
]
},
"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",
Expand All @@ -89,15 +89,15 @@
"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,8 +106,8 @@
"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",
Expand All @@ -132,7 +132,7 @@
"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",
Expand All @@ -145,7 +145,7 @@
"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
16 changes: 16 additions & 0 deletions src/content/api/module-methods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -435,4 +435,20 @@ const page = 'Foo';
__webpack_modules__[require.resolveWeak(`./page/${page}`)];
```

<<<<<<< HEAD
T> `require.resolveWeak` 是_通用渲染_(服务器端渲染 SSR + 代码分割 Code Splitting)的基础。例如在 [react-universal-component](https://github.com/faceyspacey/react-universal-component) 等包中的用法。它允许代码在服务器端和客户端初始页面的加载上同步渲染。它要求手动或以某种方式提供 chunk。它可以在不需要指示应该被打包的情况下引入模块。它与 `import()` 一起使用,当用户导航触发额外的导入时,它会被接管。
=======
T> `require.resolveWeak` is the foundation of _universal rendering_ (SSR + Code Splitting), as used in packages such as [react-universal-component](https://github.com/faceyspacey/react-universal-component). It allows code to render synchronously on both the server and initial page-loads on the client. It requires that chunks are manually served or somehow available. It's able to require modules without indicating they should be bundled into a chunk. It's used in conjunction with `import()` which takes over when user navigation triggers additional imports.

### warning

If the module source contains a require that cannot be statically analyzed, critical dependencies warning is emitted.

Example code:

```javascript
someFn(require);
require.bind(null);
require(variable);
```
>>>>>>> f82e706f243e375d5de071ed6cd3dbf437e56f73
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
16 changes: 14 additions & 2 deletions src/content/configuration/other-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -437,18 +437,30 @@ module.exports = {

### immutablePaths $#immutable-paths$

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

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

<<<<<<< HEAD
### managedPaths $#managedpaths$
=======
Make sure to wrap the path in a capture group if you use regular expressions.

`[string]`
### managedPaths
>>>>>>> f82e706f243e375d5de071ed6cd3dbf437e56f73

`(RegExp | string)[]`

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

<<<<<<< HEAD

### module $#module$
=======
Make sure to wrap the path in a capture group if you use regular expressions.

### module
>>>>>>> f82e706f243e375d5de071ed6cd3dbf437e56f73

`object = {hash boolean = true, timestamp boolean = true}`

Expand Down
Loading