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 @ a65a9beb #1579

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4a54cd1
docs: fix typo (#6191)
oscar-b Jun 2, 2022
0a76aac
build(deps-dev): bump webpack-dev-server from 4.9.0 to 4.9.1 (#6185)
dependabot[bot] Jun 3, 2022
7c94ad0
build(deps-dev): bump lint-staged from 12.4.3 to 13.0.0 (#6188)
dependabot[bot] Jun 3, 2022
7255bd5
build(deps-dev): bump http-server from 14.1.0 to 14.1.1 (#6190)
dependabot[bot] Jun 3, 2022
e14551a
build(deps-dev): bump node-fetch from 3.2.4 to 3.2.5 (#6193)
dependabot[bot] Jun 3, 2022
3506584
build(deps-dev): bump webpack from 5.72.1 to 5.73.0 (#6192)
dependabot[bot] Jun 3, 2022
bee26a6
docs(configuration): add parser options for dynamic import (#6145)
snitin315 Jun 3, 2022
c622345
Feature/downgrade react (#6197)
chenxsan Jun 3, 2022
0ccafd7
build(deps-dev): bump sass from 1.52.1 to 1.52.2 (#6199)
dependabot[bot] Jun 4, 2022
bd4c9a3
upgrade cypress to v10 (#6195)
chenxsan Jun 4, 2022
c9d41a9
build(deps-dev): bump @babel/preset-env from 7.18.0 to 7.18.2 (#6180)
dependabot[bot] Jun 4, 2022
eeaea93
build(deps-dev): bump webpack-dev-server from 4.9.1 to 4.9.2 (#6200)
dependabot[bot] Jun 7, 2022
0ce82a5
build(deps-dev): bump eslint from 8.16.0 to 8.17.0 (#6201)
dependabot[bot] Jun 7, 2022
657e6db
build(deps-dev): bump cypress from 10.0.2 to 10.0.3 (#6202)
dependabot[bot] Jun 8, 2022
8af62c6
build(deps-dev): bump jest from 28.1.0 to 28.1.1 (#6203)
dependabot[bot] Jun 8, 2022
26c50c4
build(deps-dev): bump lint-staged from 13.0.0 to 13.0.1 (#6204)
dependabot[bot] Jun 9, 2022
7d18de7
build(deps-dev): bump sass from 1.52.2 to 1.52.3 (#6208)
dependabot[bot] Jun 10, 2022
f9022fc
build(deps-dev): bump tailwindcss from 3.0.24 to 3.1.0 (#6207)
dependabot[bot] Jun 10, 2022
a65a9be
docs(api): add note about `env` usage (#6209)
snitin315 Jun 10, 2022
56f91a9
docs(en): merging all conflicts
docschina-bot Jun 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 .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ updates:
interval: "daily"
labels:
- "dependencies"
<<<<<<< HEAD
allowed_updates:
- match:
dependency_name: "textlint"
=======
ignore:
- dependency-name: "react"
- dependency-name: "react-dom"
>>>>>>> a65a9bebd9341bbbadf55edc23325b68a213b4f6
16 changes: 6 additions & 10 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Cypress run
uses: cypress-io/github-action@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- run: |
yarn
yarn cypress install
yarn cypress verify
yarn cypress:ci
config-file: cypress.config.js
build: yarn build
start: yarn serve-dist
command: yarn cypress:run
13 changes: 13 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { defineConfig } = require('cypress');

module.exports = defineConfig({
video: false,
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config);
},
baseUrl: 'http://localhost:4200',
},
});
4 changes: 0 additions & 4 deletions cypress.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"build": "run-s content && webpack --config webpack.prod.mjs --node-env production && run-s printable content && webpack --config webpack.ssg.mjs --node-env production --env ssg",
"postbuild": "npm run sitemap",
"build-test": "npm run build && http-server --port 4200 dist/",
"serve-dist": "http-server --port 4200 dist/",
"test": "npm run lint",
"lint": "run-s lint:*",
"lint:js": "npm run lint-js .",
Expand All @@ -57,7 +58,6 @@
"jest": "NODE_OPTIONS=--experimental-vm-modules jest --config=jest.config.mjs",
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"cypress:ci": "start-server-and-test build-test http://localhost:4200 cypress:run",
"prettier": "prettier --write '**/*.{js,json,jsx,css,scss,md,mdx}'",
"prepare": "husky install"
},
Expand All @@ -76,7 +76,7 @@
"@babel/core": "^7.18.2",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/preset-env": "^7.18.0",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@mdx-js/loader": "^2.0.0-next.9",
"@octokit/auth-action": "^1.3.3",
Expand All @@ -89,11 +89,11 @@
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^4.0.0",
"cypress": "^9.7.0",
"cypress": "^10.0.3",
"directory-tree": "^3.3.0",
"directory-tree-webpack-plugin": "^1.0.3",
"duplexer": "^0.1.1",
"eslint": "^8.16.0",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-mdx": "^1.17.0",
Expand All @@ -103,19 +103,19 @@
"github-slugger": "^1.4.0",
"html-loader": "^2.1.2",
"html-webpack-plugin": "^5.5.0",
"http-server": "^14.1.0",
"http-server": "^14.1.1",
"husky": "^8.0.1",
"hyperlink": "^5.0.4",
"jest": "^28.1.0",
"lint-staged": "^12.4.3",
"jest": "^28.1.1",
"lint-staged": "^13.0.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.4",
"node-fetch": "^3.2.5",
"npm-run-all": "^4.1.1",
"postcss": "^8.4.14",
"postcss-loader": "^7.0.0",
Expand All @@ -131,22 +131,21 @@
"remark-html": "^15.0.1",
"remark-refractor": "montogeek/remark-refractor",
"rimraf": "^3.0.2",
"sass": "^1.52.1",
"sass": "^1.52.3",
"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",
"tailwindcss": "^3.1.0",
"tap-spot": "^1.1.2",
"textlint": "^11.8.2",
"textlint-rule-heading": "^1.0.10",
"unist-util-visit": "^4.1.0",
"webpack": "^5.72.1",
"webpack": "^5.73.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.9.0",
"webpack-dev-server": "^4.9.2",
"webpack-merge": "^5.8.0",
"workbox-webpack-plugin": "^6.5.3"
},
Expand Down
6 changes: 6 additions & 0 deletions src/content/api/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,13 @@ npx webpack --env production # env.production = true
| `npx webpack --env foo=bar=app` | `{ foo: "bar=app"}` |
| `npx webpack --env app.platform="staging" --env app.name="test"` | `{ app: { platform: "staging", name: "test" }` |

<<<<<<< HEAD
T> 请查阅 [environment 变量指南](/guides/environment-variables/)了解更多信息及用法。
=======
T> If you want to explicitly set a variable to empty string (`""`), you may need to escape characters on terminal like `npx webpack --env foo=\"\"`

T> See the [environment variables](/guides/environment-variables/) guide for more information on its usage.
>>>>>>> a65a9bebd9341bbbadf55edc23325b68a213b4f6

除了上面所说的自定义 `env` 变量,在你的 webpack 配置中也使用了一些 `env` 内置变量:

Expand Down
61 changes: 61 additions & 0 deletions src/content/configuration/module.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,68 @@ module.exports = {
const x = require(/* webpackIgnore: true */ 'x');
```

<<<<<<< HEAD
#### module.parser.javascript.exportsPresence $#moduleparserjavascriptexportspresence$
=======
#### module.parser.javascript.dynamicImportMode

Specifies global mode for dynamic import.

- Type: `'eager' | 'weak' | 'lazy' | 'lazy-once'`
- Available: 5.73.0+
- Example:
```js
module.exports = {
module: {
parser: {
javascript: {
dynamicImportMode: 'lazy',
},
},
},
};
```

#### module.parser.javascript.dynamicImportPrefetch

Specifies global prefetch for dynamic import.

- Type: ` number | boolean`
- Available: 5.73.0+
- Example:
```js
module.exports = {
module: {
parser: {
javascript: {
dynamicImportPrefetch: false,
},
},
},
};
```

#### module.parser.javascript.dynamicImportPreload

Specifies global preload for dynamic import.

- Type: ` number | boolean`
- Available: 5.73.0+
- Example:
```js
module.exports = {
module: {
parser: {
javascript: {
dynamicImportPreload: false,
},
},
},
};
```

#### module.parser.javascript.exportsPresence
>>>>>>> a65a9bebd9341bbbadf55edc23325b68a213b4f6

指出在 `\"import ... from ...\"` 与 `\"export ... from ...\"` 中无效导出名称的行为。

Expand Down
2 changes: 1 addition & 1 deletion src/content/plugins/module-federation-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = {

Create a new runtime chunk with the specified name.

**webpack.js.org**
**webpack.config.js**

```js
const { ModuleFederationPlugin } = require('webpack').container;
Expand Down
Loading