Skip to content

docs(en): merge webpack.js.org/master into webpack.js.org/cn @ f15423e3 #1560

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

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3900c03
build(deps-dev): bump babel-loader from 8.2.4 to 8.2.5 (#6101)
dependabot[bot] Apr 22, 2022
91098f3
build(deps-dev): bump lint-staged from 12.3.8 to 12.4.0 (#6102)
dependabot[bot] Apr 22, 2022
686b83e
docs(concepts): fix typo in module resolution (#6044)
xp44mm Apr 24, 2022
80e0084
docs(configuration): add `module.parser.javascript.importMeta` (#6103)
snitin315 Apr 24, 2022
9d15541
docs: add info about moving modules to parent chunks (#6104)
snitin315 Apr 25, 2022
1f30128
build(deps-dev): bump sass from 1.50.1 to 1.51.0 (#6113)
dependabot[bot] Apr 28, 2022
8347c58
build(deps-dev): bump cypress from 9.5.4 to 9.6.0 (#6110)
dependabot[bot] Apr 28, 2022
cc4de4a
build(deps-dev): bump autoprefixer from 10.4.4 to 10.4.5 (#6111)
dependabot[bot] Apr 28, 2022
7d89e3b
build(deps-dev): bump eslint from 8.13.0 to 8.14.0 (#6109)
dependabot[bot] Apr 28, 2022
5457551
updated AG Grid logo in docs to current version (#6120)
eviltester Apr 29, 2022
f67af70
build(deps-dev): bump lint-staged from 12.4.0 to 12.4.1 (#6114)
dependabot[bot] Apr 29, 2022
80d3cf8
build(deps-dev): bump eslint-plugin-react-hooks from 4.4.0 to 4.5.0 (…
dependabot[bot] Apr 29, 2022
0ac288d
build(deps): bump ejs from 3.1.6 to 3.1.7 (#6117)
dependabot[bot] Apr 30, 2022
bf19f40
build(deps-dev): bump react-refresh from 0.12.0 to 0.13.0 (#6118)
dependabot[bot] Apr 30, 2022
a5492d4
build(deps-dev): bump node-fetch from 3.2.3 to 3.2.4 (#6119)
dependabot[bot] Apr 30, 2022
1d1dc2e
build(deps-dev): bump jest from 27.5.1 to 28.0.3 (#6121)
dependabot[bot] Apr 30, 2022
e0e3404
build(deps-dev): bump @babel/preset-env from 7.16.11 to 7.17.10 (#6122)
dependabot[bot] Apr 30, 2022
0bb033f
build(deps-dev): bump @babel/core from 7.17.9 to 7.17.10 (#6123)
dependabot[bot] Apr 30, 2022
07502e9
docs(guides): mention outputPath and publicPath (#6124)
chenxsan Apr 30, 2022
3e08fb7
build(deps-dev): bump autoprefixer from 10.4.5 to 10.4.7 (#6127)
dependabot[bot] May 5, 2022
0167c49
build(deps-dev): bump postcss from 8.4.12 to 8.4.13 (#6128)
dependabot[bot] May 5, 2022
fa960a9
build(deps-dev): bump @parcel/css from 1.8.1 to 1.8.2 (#6129)
dependabot[bot] May 5, 2022
4da8291
Fixed a Type in Hot Module Replacement Page (#6134)
Dhananjay-JSR May 8, 2022
91cfff5
build(deps-dev): bump jest from 28.0.3 to 28.1.0 (#6133)
dependabot[bot] May 10, 2022
b6da8d9
build(deps): bump react-spring from 9.4.4 to 9.4.5 (#6130)
dependabot[bot] May 10, 2022
5015de0
build(deps-dev): bump webpack-dev-server from 4.8.1 to 4.9.0 (#6131)
dependabot[bot] May 10, 2022
77f7f5d
build(deps-dev): bump husky from 7.0.4 to 8.0.1 (#6135)
dependabot[bot] May 10, 2022
5ddc78d
build(deps-dev): bump cypress from 9.6.0 to 9.6.1 (#6136)
dependabot[bot] May 10, 2022
30559c7
build(deps-dev): bump eslint from 8.14.0 to 8.15.0 (#6137)
dependabot[bot] May 10, 2022
276b725
build(deps-dev): bump tap-spot from 1.1.1 to 1.1.2 (#6138)
dependabot[bot] May 10, 2022
4348403
docs(api): document addMissingDependency for loader context (#6132)
sokra May 10, 2022
1a8aaae
build(deps-dev): bump webpack from 5.72.0 to 5.72.1 (#6141)
dependabot[bot] May 11, 2022
8dbb6e6
build(deps-dev): bump @pmmmwh/react-refresh-webpack-plugin (#6140)
dependabot[bot] May 14, 2022
a686ebe
build(deps-dev): bump @parcel/css from 1.8.2 to 1.8.3 (#6143)
dependabot[bot] May 14, 2022
0bca7e3
docs: correct spelling of streaming (#6144)
stephenlin35 May 15, 2022
10cf100
build(deps-dev): bump postcss from 8.4.13 to 8.4.14 (#6152)
dependabot[bot] May 19, 2022
7efb3cd
build(deps): bump async from 2.6.3 to 2.6.4 (#6146)
dependabot[bot] May 19, 2022
855561a
build(deps-dev): bump @babel/core from 7.17.10 to 7.17.12 (#6151)
dependabot[bot] May 19, 2022
561f435
build(deps-dev): bump postcss-loader from 6.2.1 to 7.0.0 (#6156)
dependabot[bot] May 19, 2022
f13ec0b
build(deps-dev): bump @babel/plugin-proposal-class-properties (#6147)
dependabot[bot] May 20, 2022
c712328
build(deps-dev): bump @babel/preset-react from 7.16.7 to 7.17.12 (#6150)
dependabot[bot] May 20, 2022
f091eb6
build(deps-dev): bump eslint-plugin-react from 7.29.4 to 7.30.0 (#6159)
dependabot[bot] May 20, 2022
9835b64
build(deps-dev): bump css-minimizer-webpack-plugin from 3.4.1 to 4.0.…
dependabot[bot] May 20, 2022
9d9f1da
build(deps-dev): bump @babel/preset-env from 7.17.10 to 7.18.0 (#6157)
dependabot[bot] May 20, 2022
e552cd1
build(deps-dev): bump sass-loader from 12.6.0 to 13.0.0 (#6155)
dependabot[bot] May 20, 2022
ead9cd5
build(deps-dev): bump copy-webpack-plugin from 10.2.4 to 11.0.0 (#6148)
dependabot[bot] May 20, 2022
3a3b299
build(deps-dev): bump @babel/core from 7.17.12 to 7.18.0 (#6160)
dependabot[bot] May 21, 2022
8b6d2f0
build(deps): bump react-use from 17.3.2 to 17.4.0 (#6162)
dependabot[bot] May 21, 2022
f15423e
build(deps-dev): bump sass from 1.51.0 to 1.52.0 (#6161)
dependabot[bot] May 21, 2022
c6cd24a
docs(en): merging all conflicts
docschina-bot May 21, 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
56 changes: 30 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,54 +73,54 @@
]
},
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/core": "^7.18.0",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/preset-env": "^7.18.0",
"@babel/preset-react": "^7.17.12",
"@mdx-js/loader": "^2.0.0-next.9",
"@octokit/auth-action": "^1.3.3",
"@octokit/rest": "^18.12.0",
"@parcel/css": "^1.8.1",
"@parcel/css": "^1.8.3",
"@pmmmwh/react-refresh-webpack-plugin": "next",
"@svgr/webpack": "^6.2.1",
"autoprefixer": "^10.4.4",
"babel-loader": "^8.2.4",
"copy-webpack-plugin": "^10.2.4",
"autoprefixer": "^10.4.7",
"babel-loader": "^8.2.5",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^3.4.1",
"cypress": "^9.5.4",
"css-minimizer-webpack-plugin": "^4.0.0",
"cypress": "^9.6.1",
"directory-tree": "^3.2.2",
"directory-tree-webpack-plugin": "^1.0.3",
"duplexer": "^0.1.1",
"eslint": "^8.13.0",
"eslint": "^8.15.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-mdx": "^1.17.0",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^4.5.0",
"front-matter": "^4.0.2",
"github-slugger": "^1.4.0",
"html-loader": "^2.1.2",
"html-webpack-plugin": "^5.5.0",
"http-server": "^14.1.0",
"husky": "^7.0.4",
"husky": "^8.0.1",
"hyperlink": "^5.0.4",
"jest": "^27.5.1",
"lint-staged": "^12.3.8",
"jest": "^28.1.0",
"lint-staged": "^12.4.1",
"lodash": "^4.17.21",
"markdownlint": "^0.25.1",
"markdownlint-cli": "^0.31.1",
"mdast-util-to-string": "^3.1.0",
"mini-css-extract-plugin": "^2.6.0",
"mkdirp": "^1.0.4",
"modularscale-sass": "^3.0.3",
"node-fetch": "^3.2.3",
"node-fetch": "^3.2.4",
"npm-run-all": "^4.1.1",
"postcss": "^8.4.12",
"postcss-loader": "^6.2.1",
"postcss": "^8.4.14",
"postcss-loader": "^7.0.0",
"prettier": "^2.6.2",
"react-refresh": "^0.12.0",
"react-refresh": "^0.13.0",
"redirect-webpack-plugin": "^1.0.0",
"remark": "^14.0.2",
"remark-autolink-headings": "7.0.1",
Expand All @@ -131,22 +131,26 @@
"remark-html": "^15.0.1",
"remark-refractor": "montogeek/remark-refractor",
"rimraf": "^3.0.2",
"sass": "^1.50.1",
"sass-loader": "^12.6.0",
"sass": "^1.52.0",
"sass-loader": "^13.0.0",
"sirv-cli": "^2.0.2",
"sitemap-static": "^0.4.2",
"start-server-and-test": "^1.14.0",
"static-site-generator-webpack-plugin": "^3.4.1",
"style-loader": "^3.3.1",
"tailwindcss": "^3.0.24",
<<<<<<< HEAD
"tap-spot": "^1.1.1",
"textlint": "^11.8.2",
"textlint-rule-heading": "^1.0.10",
=======
"tap-spot": "^1.1.2",
>>>>>>> f15423e367b14375a59681ca78d2c5e23e68e312
"unist-util-visit": "^4.1.0",
"webpack": "^5.72.0",
"webpack": "^5.72.1",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.1",
"webpack-dev-server": "^4.9.0",
"webpack-merge": "^5.8.0",
"workbox-webpack-plugin": "^6.5.3"
},
Expand All @@ -158,9 +162,9 @@
"react-dom": "^17.0.2",
"react-helmet-async": "^1.3.0",
"react-router-dom": "^6.3.0",
"react-spring": "^9.4.4",
"react-spring": "^9.4.5",
"react-tiny-popover": "5",
"react-use": "^17.3.2",
"react-use": "^17.4.0",
"react-visibility-sensor": "^5.0.2",
"webpack-pwa-manifest": "^4.3.0",
"webpack.vote": "https://github.com/webpack/voting-app.git",
Expand Down
Binary file modified src/assets/ag-grid-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/content/api/hot-module-replacement.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if (module.hot) {
// or
if (import.meta.webpackHot) {
import.meta.webpackHot.accept('./library.js', function () {
// Do something with the updated library modue
// Do something with the updated library module
});
}
```
Expand Down
12 changes: 12 additions & 0 deletions src/content/api/loaders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,19 @@ addDependency(file: string)
dependency(file: string) // shortcut
```

<<<<<<< HEAD
加入一个文件作为产生 loader 结果的依赖,使它们的任何变化可以被监听到。例如,[`sass-loader`](https://github.com/webpack-contrib/sass-loader), [`less-loader`](https://github.com/webpack-contrib/less-loader) 就使用了这个技巧,当它发现无论何时导入的 `css` 文件发生变化时就会重新编译。
=======
Add an existing file as a dependency of the loader result in order to make them watchable. For example, [`sass-loader`](https://github.com/webpack-contrib/sass-loader), [`less-loader`](https://github.com/webpack-contrib/less-loader) uses this to recompile whenever any imported `css` file changes.

### this.addMissingDependency

```typescript
addMissingDependency(file: string)
```

Add a non-existing file as a dependency of the loader result in order to make them watchable. Similar to `addDependency`, but handles the creation of files during compilation before watchers are attached correctly.
>>>>>>> f15423e367b14375a59681ca78d2c5e23e68e312

### this.async $#thisasync$

Expand Down
4 changes: 4 additions & 0 deletions src/content/concepts/module-resolution.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ import '../src/file1';
import './file2';
```

<<<<<<< HEAD
在这种情况下,使用 `import` 或 `require` 的资源文件所处的目录,被认为是上下文目录。在 `import/require` 中给定的相对路径,会拼接此上下文路径,来生成模块的绝对路径。
=======
In this case, the directory of the source file where the `import` or `require` occurs is taken to be the context directory. The relative path specified in the `import/require` is joined to this context path to produce the absolute path to the module.
>>>>>>> f15423e367b14375a59681ca78d2c5e23e68e312

### 模块路径 $#module-paths$

Expand Down
19 changes: 19 additions & 0 deletions src/content/configuration/module.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,25 @@ const x = require(/* webpackIgnore: true */ 'x');
};
```

#### module.parser.javascript.importMeta

Enable or disable evaluating `import.meta`.

- Type: `boolean = true`
- Available: 5.68.0+
- Example:
```js
module.exports = {
module: {
parser: {
javascript: {
importMeta: false,
},
},
},
};
```

#### module.parser.javascript.importMetaContext

启用/禁用 [`import.meta.webpackContext`](/api/module-variables/#importmetawebpackcontext) 分析。
Expand Down
4 changes: 4 additions & 0 deletions src/content/guides/asset-modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ import mainImage from './images/main.png';
img.src = mainImage; // '/dist/151cfcfa1bd74779aadb.png'
```

<<<<<<< HEAD
所有 `.png` 文件都将被发送到输出目录,并且其路径将被注入到 bundle 中。
=======
All `.png` files will be emitted to the output directory and their paths will be injected into the bundles, besides, you can customize [`outputPath`](/configuration/module/#rulegeneratoroutputpath) and [`publicPath`](/configuration/module/#rulegeneratorpublicpath) for them.
>>>>>>> f15423e367b14375a59681ca78d2c5e23e68e312

### 自定义输出文件名 $#custom-output-filename$

Expand Down
4 changes: 4 additions & 0 deletions src/content/guides/code-splitting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,11 @@ import(/* webpackPreload: true */ 'ChartingLibrary');

T> 不正确地使用 `webpackPreload` 会有损性能,请谨慎使用。

<<<<<<< HEAD
有时你需要自己控制预加载。例如,任何动态导入的预加载都可以通过异步脚本完成。这在流式服务器端渲染的情况下很有用。
=======
Sometimes you need to have your own control over preload. For example, preload of any dynamic import can be done via async script. This can be useful in case of streaming server side rendering.
>>>>>>> f15423e367b14375a59681ca78d2c5e23e68e312

```js
const lazyComp = () =>
Expand Down
2 changes: 2 additions & 0 deletions src/content/plugins/split-chunks-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ T> 设置 `maxSize` 的值会同时设置 `maxAsyncSize` 和 `maxInitialSize`

如果 `splitChunks.name` 与 [entry point](/configuration/entry-context/#entry) 名称匹配,entry point 将被删除。

T> `splitChunks.cacheGroups.{cacheGroup}.name` can be used to move modules into a chunk that is a parent of the source chunk. For example, use `name: "entry-name"` to move modules into the `entry-name` chunk. You can also use on demand named chunks, but you must be careful that the selected modules are only used under this chunk.

**main.js**

```js
Expand Down
Loading