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 @ 04af2009 #1673

Closed
wants to merge 79 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
77af75a
build(deps-dev): bump markdownlint from 0.26.0 to 0.26.1 (#6294)
dependabot[bot] Jul 26, 2022
261eb5a
build(deps-dev): bump markdownlint-cli from 0.32.0 to 0.32.1 (#6298)
dependabot[bot] Jul 26, 2022
6d08f78
build(deps-dev): bump webpack from 5.73.0 to 5.74.0 (#6299)
dependabot[bot] Jul 26, 2022
ff684da
build(deps): bump react-spring from 9.5.1 to 9.5.2 (#6295)
dependabot[bot] Jul 26, 2022
2cb2f38
build(deps-dev): bump sass from 1.53.0 to 1.54.0 (#6296)
dependabot[bot] Jul 26, 2022
92a1564
chore: run `yarn-deduplicate --strategy fewer` for fewer acorn versio…
JounQin Jul 26, 2022
7666871
chore: ensure to run yarn-deduplicate with fewer strategy (#6301)
JounQin Jul 27, 2022
9a96b9d
build(deps): bump workbox-window from 6.5.3 to 6.5.4 (#6302)
dependabot[bot] Jul 29, 2022
7db74c8
build(deps-dev): bump workbox-webpack-plugin from 6.5.3 to 6.5.4 (#6303)
dependabot[bot] Jul 29, 2022
2b2d523
build(deps-dev): bump tailwindcss from 3.1.6 to 3.1.7 (#6304)
dependabot[bot] Jul 30, 2022
21e94ff
build(deps-dev): bump autoprefixer from 10.4.7 to 10.4.8 (#6305)
dependabot[bot] Jul 30, 2022
04019a7
build(deps-dev): bump eslint from 8.20.0 to 8.21.0 (#6309)
dependabot[bot] Aug 2, 2022
51473c7
build(deps-dev): bump @parcel/css from 1.12.0 to 1.12.2 (#6306)
dependabot[bot] Aug 2, 2022
d4ed5b7
build(deps-dev): bump node-fetch from 3.2.9 to 3.2.10 (#6307)
dependabot[bot] Aug 2, 2022
0dd19bc
build(deps-dev): bump @babel/core from 7.18.9 to 7.18.10 (#6308)
dependabot[bot] Aug 2, 2022
4042c65
build(deps-dev): bump @babel/preset-env from 7.18.9 to 7.18.10 (#6310)
dependabot[bot] Aug 2, 2022
297431a
build(deps-dev): bump cypress from 10.3.1 to 10.4.0 (#6312)
dependabot[bot] Aug 3, 2022
8fd56ee
docs(guides): Update broken link to PWA resource (#6313)
apettenati Aug 4, 2022
5a25da1
build(deps-dev): bump sass from 1.54.0 to 1.54.1 (#6314)
dependabot[bot] Aug 4, 2022
5e524df
build(deps-dev): bump sass from 1.54.1 to 1.54.2 (#6315)
dependabot[bot] Aug 5, 2022
0a882d9
build(deps-dev): bump tailwindcss from 3.1.7 to 3.1.8 (#6317)
dependabot[bot] Aug 6, 2022
cb03b86
build(deps-dev): bump sass from 1.54.2 to 1.54.3 (#6318)
dependabot[bot] Aug 6, 2022
b355406
docs(configuraExplain the externals string syntax specifying external…
tanhauhau Aug 8, 2022
94b1541
build(deps-dev): bump postcss from 8.4.14 to 8.4.16 (#6323)
dependabot[bot] Aug 9, 2022
7046bee
docs(Configurations): explain default value of output.chunkFormat and…
tanhauhau Aug 10, 2022
bf9cba0
build(deps-dev): bump markdownlint from 0.26.1 to 0.26.2 (#6325)
dependabot[bot] Aug 11, 2022
7654960
build(deps-dev): bump sass from 1.54.3 to 1.54.4 (#6326)
dependabot[bot] Aug 11, 2022
1b51d39
build(deps-dev): bump webpack-dev-server from 4.9.3 to 4.10.0 (#6327)
dependabot[bot] Aug 11, 2022
54a882f
docs(Configuration): Update path to invalidate (#6324)
andrzej-erli Aug 12, 2022
ca4bca4
update deploy.yml (#6328)
chenxsan Aug 13, 2022
e15304d
build(deps-dev): bump eslint from 8.21.0 to 8.22.0 (#6333)
dependabot[bot] Aug 16, 2022
f1efc88
docs(blog): Update 2020-10-10-webpack-5-release.mdx (#6331)
airman5573 Aug 16, 2022
7bd2e80
docs(api): update custom hooks API for plugins (#6319)
snitin315 Aug 16, 2022
99d6615
build(deps-dev): bump @octokit/rest from 19.0.3 to 19.0.4 (#6332)
dependabot[bot] Aug 17, 2022
b52c19b
build(deps-dev): bump @octokit/auth-action from 2.0.0 to 2.0.1 (#6334)
dependabot[bot] Aug 17, 2022
9c0db76
build(deps-dev): bump cypress from 10.4.0 to 10.5.0 (#6338)
dependabot[bot] Aug 17, 2022
e19a110
docs(loaders): add link to esbuild-loader (#6337)
MasterOdin Aug 17, 2022
a0c12be
docs(Configuration): Fix type for ctx.contextInfo (#6340)
huozhi Aug 18, 2022
9f18c78
build(deps-dev): bump yarn-deduplicate from 5.0.0 to 5.0.2 (#6335)
dependabot[bot] Aug 18, 2022
542365d
build(deps-dev): bump cypress from 10.5.0 to 10.6.0 (#6342)
dependabot[bot] Aug 20, 2022
4274e9a
build(deps-dev): bump webpack-bundle-analyzer from 4.5.0 to 4.6.0 (#6…
dependabot[bot] Aug 20, 2022
7e95f4a
build(deps-dev): bump @babel/core from 7.18.10 to 7.18.13 (#6350)
dependabot[bot] Aug 23, 2022
a77733c
build(deps-dev): bump webpack-bundle-analyzer from 4.6.0 to 4.6.1 (#6…
dependabot[bot] Aug 23, 2022
d0e18bc
build(deps-dev): bump @parcel/css from 1.12.2 to 1.13.0 (#6345)
dependabot[bot] Aug 23, 2022
4eb09ae
build(deps-dev): bump sass from 1.54.4 to 1.54.5 (#6348)
dependabot[bot] Aug 23, 2022
59c6cea
docs(Configuration): explain more on the condition names (#6330)
tanhauhau Aug 23, 2022
7627044
build(deps-dev): bump unist-util-visit from 4.1.0 to 4.1.1 (#6346)
dependabot[bot] Aug 23, 2022
421c244
build(deps-dev): bump markdownlint-cli from 0.32.1 to 0.32.2 (#6347)
dependabot[bot] Aug 23, 2022
b271ca9
fix(Configuration): correct typo in the setupMiddlewares example (#6352)
TPXP Aug 25, 2022
231d9bf
docs(api): syntax fix in Inline matchResource (#6353)
vinicius-caputo Aug 25, 2022
f5b8977
build(deps-dev): bump eslint-plugin-react from 7.30.1 to 7.31.0 (#6354)
dependabot[bot] Aug 26, 2022
8aa8bc2
build(deps-dev): bump jest from 28.1.3 to 29.0.0 (#6355)
dependabot[bot] Aug 26, 2022
fbb4bc7
fix(Configuration.scss): fix config dialog pre element with block sty…
JunIce Aug 27, 2022
d3c3591
build(deps-dev): bump jest from 29.0.0 to 29.0.1 (#6357)
dependabot[bot] Aug 29, 2022
6492712
build(deps-dev): bump eslint-plugin-react from 7.31.0 to 7.31.1 (#6359)
dependabot[bot] Aug 30, 2022
aba928d
build(deps-dev): bump eslint from 8.22.0 to 8.23.0 (#6360)
dependabot[bot] Aug 30, 2022
08a660d
build(deps-dev): bump yarn-deduplicate from 5.0.2 to 6.0.0 (#6361)
dependabot[bot] Aug 30, 2022
73993d9
build(deps-dev): bump webpack-dev-server from 4.10.0 to 4.10.1 (#6362)
dependabot[bot] Aug 30, 2022
db5dcd2
docs(Configuration): remove typo extra underscore (#6358)
peilingjiang Aug 31, 2022
ebfdaef
build(deps-dev): bump cypress from 10.6.0 to 10.7.0 (#6363)
dependabot[bot] Aug 31, 2022
dc92ed7
build(deps-dev): bump sass from 1.54.5 to 1.54.6 (#6364)
dependabot[bot] Aug 31, 2022
c711493
drop node 17 (#6365)
chenxsan Aug 31, 2022
3381e63
update snapshots (#6366)
chenxsan Aug 31, 2022
7b23419
build(deps-dev): bump sass from 1.54.6 to 1.54.7 (#6368)
dependabot[bot] Sep 1, 2022
6802655
build(deps-dev): bump sass from 1.54.7 to 1.54.8 (#6369)
dependabot[bot] Sep 3, 2022
c15911d
build(deps-dev): bump directory-tree from 3.3.0 to 3.3.1 (#6370)
dependabot[bot] Sep 3, 2022
5fa895c
build(deps-dev): bump @parcel/css from 1.13.0 to 1.13.1 (#6371)
dependabot[bot] Sep 3, 2022
91cb3ba
docs(Guides): Grammar correction (#6372)
4127157 Sep 5, 2022
2dd9b9f
build(deps-dev): bump jest from 29.0.1 to 29.0.2 (#6375)
dependabot[bot] Sep 6, 2022
55d1e28
build(deps-dev): bump eslint-plugin-mdx from 2.0.2 to 2.0.3 (#6374)
dependabot[bot] Sep 6, 2022
97638c3
build(deps-dev): bump @babel/core from 7.18.13 to 7.19.0 (#6378)
dependabot[bot] Sep 7, 2022
9b39e15
build(deps-dev): bump eslint-plugin-mdx from 2.0.3 to 2.0.4 (#6381)
dependabot[bot] Sep 7, 2022
d75188c
build(deps-dev): bump webpack-dev-server from 4.10.1 to 4.11.0 (#6382)
dependabot[bot] Sep 8, 2022
941ca15
build(deps-dev): upgrade eslint plugin react (#6383)
chenxsan Sep 8, 2022
7408091
build(deps-dev): bump @babel/preset-env from 7.18.10 to 7.19.0 (#6379)
dependabot[bot] Sep 8, 2022
61992aa
build(deps-dev): bump sass from 1.54.8 to 1.54.9 (#6386)
dependabot[bot] Sep 9, 2022
8d917b7
build(deps-dev): bump @parcel/css from 1.13.1 to 1.14.0 (#6385)
dependabot[bot] Sep 9, 2022
04af200
build(deps-dev): bump eslint-plugin-react from 7.31.7 to 7.31.8 (#6387)
dependabot[bot] Sep 10, 2022
cac8c7c
docs(en): merging all conflicts
docschina-bot Sep 10, 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
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ module.exports = {
'react/react-in-jsx-scope': 'off', // ditto
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/no-unknown-property': [
'error',
{
ignore: ['watch', 'align'],
},
],
},
settings: {
react: {
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ jobs:
- run: yarn lint:links

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.2.5
uses: JamesIves/github-pages-deploy-action@v4.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: dist
clean: true
19 changes: 19 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ on:
pull_request:

jobs:
unitTest:
name: Unit Test
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- run: yarn --frozen-lockfile
- run: yarn jest

lint:
name: Lint
strategy:
Expand Down
56 changes: 31 additions & 25 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": ">=14"
"node": "^14.20.0 || ^16.15.0 || >=18.0.0"
},
"scripts": {
"clean-dist": "rimraf ./dist",
Expand Down Expand Up @@ -59,8 +59,7 @@
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"prettier": "prettier --write '**/*.{js,json,jsx,css,scss,md,mdx}'",
"prepare": "husky install",
"postinstall": "rimraf ./node_modules/.cache/webpack"
"prepare": "husky install && rimraf ./node_modules/.cache/webpack && yarn-deduplicate --strategy fewer"
},
"lint-staged": {
"*.{js,jsx,md,mdx}": [
Expand All @@ -74,31 +73,31 @@
]
},
"devDependencies": {
"@babel/core": "^7.18.9",
"@babel/core": "^7.19.0",
"@babel/eslint-parser": "^7.18.9",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/preset-env": "^7.18.9",
"@babel/preset-env": "^7.19.0",
"@babel/preset-react": "^7.18.6",
"@mdx-js/loader": "^2.0.0-next.9",
"@octokit/auth-action": "^2.0.0",
"@octokit/rest": "^19.0.3",
"@parcel/css": "^1.12.0",
"@octokit/auth-action": "^2.0.1",
"@octokit/rest": "^19.0.4",
"@parcel/css": "^1.14.0",
"@pmmmwh/react-refresh-webpack-plugin": "next",
"@svgr/webpack": "^6.3.1",
"autoprefixer": "^10.4.7",
"autoprefixer": "^10.4.8",
"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.3.1",
"directory-tree": "^3.3.0",
"cypress": "^10.7.0",
"directory-tree": "^3.3.1",
"directory-tree-webpack-plugin": "^1.0.3",
"duplexer": "^0.1.1",
"eslint": "^8.20.0",
"eslint": "^8.23.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-mdx": "^2.0.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-mdx": "^2.0.4",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-react-hooks": "^4.6.0",
"front-matter": "^4.0.2",
"github-slugger": "^1.4.0",
Expand All @@ -107,18 +106,18 @@
"http-server": "^14.1.1",
"husky": "^8.0.1",
"hyperlink": "^5.0.4",
"jest": "^28.1.3",
"jest": "^29.0.2",
"lint-staged": "^13.0.3",
"lodash": "^4.17.21",
"markdownlint": "^0.26.0",
"markdownlint-cli": "^0.32.0",
"markdownlint": "^0.26.2",
"markdownlint-cli": "^0.32.2",
"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.9",
"node-fetch": "^3.2.10",
"npm-run-all": "^4.1.1",
"postcss": "^8.4.14",
"postcss": "^8.4.16",
"postcss-loader": "^7.0.1",
"prettier": "^2.7.1",
"react-refresh": "^0.14.0",
Expand All @@ -132,23 +131,30 @@
"remark-html": "^15.0.1",
"remark-refractor": "montogeek/remark-refractor",
"rimraf": "^3.0.2",
"sass": "^1.53.0",
"sass": "^1.54.9",
"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.6",
"tailwindcss": "^3.1.8",
"tap-spot": "^1.1.2",
<<<<<<< HEAD
"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",
=======
"unist-util-visit": "^4.1.1",
"webpack": "^5.74.0",
"webpack-bundle-analyzer": "^4.6.1",
>>>>>>> 04af2009f52024d956cf5c5d227e5d56f0ad7c63
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3",
"webpack-dev-server": "^4.11.0",
"webpack-merge": "^5.8.0",
"workbox-webpack-plugin": "^6.5.3"
"workbox-webpack-plugin": "^6.5.4",
"yarn-deduplicate": "^6.0.0"
},
"dependencies": {
"@docsearch/react": "^3.0.0-alpha.50",
Expand All @@ -158,13 +164,13 @@
"react-dom": "^17.0.2",
"react-helmet-async": "^1.3.0",
"react-router-dom": "^6.3.0",
"react-spring": "^9.5.1",
"react-spring": "^9.5.2",
"react-tiny-popover": "5",
"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",
"workbox-window": "^6.5.3"
"workbox-window": "^6.5.4"
},
"resolutions": {
"sitemap-static/minimist": "1.2.5",
Expand Down
5 changes: 5 additions & 0 deletions src/components/Configuration/Configuration.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
overflow: visible;
border-radius: 4px;
box-shadow: -1px 1px 10px 0 rgba(255, 255, 255, 0.44);

pre.inline {
padding: 0;
display: block;
}
}

.shadow > .markdown {
Expand Down
4 changes: 2 additions & 2 deletions src/content/api/loaders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ console.log('yep');
**extract-style-loader/index.js**

```javascript
const getStylesLoader = require.resolve('./getStyle');
const getStylesLoader = require.resolve('./getStyles');

module.exports = function (source) {
if (STYLES_REGEXP.test(source)) {
Expand All @@ -736,7 +736,7 @@ module.exports = function (source) {

```javascript
module.exports = function (source) {
const match = STYLES_REGEXP.match(source);
const match = source.match(STYLES_REGEXP);
return match[0];
};
```
Expand Down
56 changes: 54 additions & 2 deletions src/content/api/plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ contributors:
- byzyk
- EugeneHlushko
- wizardofhogwarts
<<<<<<< HEAD
translators:
- chenzesam
- QC-L
=======
- snitin315
>>>>>>> 04af2009f52024d956cf5c5d227e5d56f0ad7c63
---

插件是 webpack 生态的关键部分,
Expand Down Expand Up @@ -90,18 +94,66 @@ compiler.hooks.run.tapPromise(

## 自定义钩子 $#custom-hooks$

<<<<<<< HEAD
为了便于其他插件的编译过程中可以 `tap` 到,则需要创建一个新的 hook,
我们只需要简单的从 `tapable` 中 `require` 所需的 hook 类,并创建:
=======
In order to offer a custom hook to the compilation for other plugins to `tap` into,
you need to do the following:
>>>>>>> 04af2009f52024d956cf5c5d227e5d56f0ad7c63

```js
const SyncHook = require('tapable').SyncHook;
1. Create a module-scope `WeakMap` for compilation hooks:

<<<<<<< HEAD
if (compiler.hooks.myCustomHook) throw new Error('已存在该钩子');
compiler.hooks.myCustomHook = new SyncHook(['a', 'b', 'c']);

// 在你想要触发钩子的位置/时机下调用……
compiler.hooks.myCustomHook.call(a, b, c);
```
=======
```ts
const compilationHooks = new WeakMap<Compilation, MyHooks>();

interface MyHooks {
custom: SyncHook<[number, string]>;
}
```

2. Create a static method on your plugin:

```ts
static getCompilationHooks(compilation: Compilation) : MyHooks {
let hooks = compilationHooks.get(compilation);
if(hooks === undefined) {
compilationHooks.set(compilation, hooks = {
custom: new SyncHook()
});
}
return hooks;
}
```

3. Call hooks like below in your plugin:

```ts
const hooks = MyPlugin.getCompilationHooks(compilation);

hooks.custom.call(1, 'hello');
```

4. Other plugins can access your custom hooks too:

```ts
import MyPlugin from 'my-plugin';

const hooks = MyPlugin.getCompilationHooks(compilation);

hooks.custom.tap('OtherPlugin', (n, s) => {
// magic
});
```
>>>>>>> 04af2009f52024d956cf5c5d227e5d56f0ad7c63

再次声明,
查看 `tapable` [文档](https://github.com/webpack/tapable) 来了解更多不同的钩子类(hook class),以及它们是如何工作的。
Expand Down
4 changes: 4 additions & 0 deletions src/content/blog/2020-10-10-webpack-5-release.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ export function test() {

当设置`"sideEffects": false`时,可以省略更多的模块。在这个例子中,当 `test` 导出未被使用时,`./something` 将被省略。

<<<<<<< HEAD
要获得未使用的导出信息,需要使用 `optimization.unusedExports`。要删除无副作用的模块,需要使用`optimization.sideEffects`。
=======
To get the information about unused exports `optimization.usedExports` is required. To remove side-effect-free modules `optimization.sideEffects` is required.
>>>>>>> 04af2009f52024d956cf5c5d227e5d56f0ad7c63

可以分析以下标记。

Expand Down
9 changes: 9 additions & 0 deletions src/content/configuration/dev-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ W> 请注意,当[导出多个配置对象](/configuration/configuration-types/

T> 如果你碰到了问题,请将路由导航至 `/webpack-dev-server` 将会为你展示服务文件的位置。例如: `http://localhost:9000/webpack-dev-server`。

<<<<<<< HEAD
T> 如果你需要要手动重新编译 `bundle`,将路由导航至 `/invalidate` 使当前编译的 `bundle` [无效](/api/node/#invalidate-watching),并通过 [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware#invalidate) 为你重新编译。根据你的配置,URL 可能看起来像 `http://localhost:9000/invalidate`。
=======
T> If you want to manually recompile the bundle, navigating to the `/webpack-dev-server/invalidate` route will [invalidate](/api/node/#invalidate-watching) the current compilation of the bundle and recompile it for you via [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware#invalidate). Depending on your configuration, the URL may look like `http://localhost:9000/webpack-dev-server/invalidate`.
>>>>>>> 04af2009f52024d956cf5c5d227e5d56f0ad7c63

T> 当启动本地服务的时候 HTML 模板是必须提供的,通常是 `index.html`。确保将脚本引用添加到 HTML 中,webpack-dev-server 不会自动注入它们。

Expand Down Expand Up @@ -1584,8 +1588,13 @@ module.exports = {
// 如果你想在所有其他中间件之前运行一个中间件或者当你从 `onBeforeSetupMiddleware` 配置项迁移时,
// 可以使用 `unshift` 方法
middlewares.unshift({
<<<<<<< HEAD
name: 'fist-in-array',
// `path` 是可选的
=======
name: 'first-in-array',
// `path` is optional
>>>>>>> 04af2009f52024d956cf5c5d227e5d56f0ad7c63
path: '/foo/path',
middleware: (req, res) => {
res.send('Foo!');
Expand Down
Loading