Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
bb06b28
build(deps-dev): bump jest from 27.5.0 to 27.5.1 (#5951)
dependabot[bot] Feb 8, 2022
409f7d0
fix issue#5945 (#5947)
chenxsan Feb 10, 2022
5be2b45
build(deps-dev): bump tailwindcss from 3.0.18 to 3.0.19 (#5952)
dependabot[bot] Feb 10, 2022
6940749
fix svg color for dark mode (#5957)
chenxsan Feb 11, 2022
944426a
build(deps-dev): bump @babel/core from 7.17.0 to 7.17.2 (#5953)
dependabot[bot] Feb 11, 2022
971d459
build(deps-dev): bump directory-tree from 3.1.0 to 3.2.0 (#5954)
dependabot[bot] Feb 11, 2022
423972e
build(deps-dev): bump tailwindcss from 3.0.19 to 3.0.22 (#5961)
dependabot[bot] Feb 12, 2022
1c11888
build(deps-dev): bump directory-tree from 3.2.0 to 3.2.1 (#5962)
dependabot[bot] Feb 12, 2022
aca0615
build(deps): bump follow-redirects from 1.14.7 to 1.14.8 (#5963)
dependabot[bot] Feb 12, 2022
f0353c6
build(deps-dev): bump markdownlint-cli from 0.31.0 to 0.31.1 (#5955)
dependabot[bot] Feb 13, 2022
6a74a3c
docs(api): update description for `WEBPACK_SERVE` env variable (#5965)
snitin315 Feb 13, 2022
a345efa
build(deps-dev): bump eslint from 8.8.0 to 8.9.0 (#5967)
dependabot[bot] Feb 15, 2022
9cd1fb0
docs(configuration): add note for resource name when filename is data…
snitin315 Feb 16, 2022
05fd0bc
build(deps-dev): bump lint-staged from 12.3.3 to 12.3.4 (#5968)
dependabot[bot] Feb 16, 2022
071299e
build(deps-dev): bump webpack from 5.68.0 to 5.69.0 (#5972)
dependabot[bot] Feb 16, 2022
721a919
build(deps-dev): bump cypress from 9.4.1 to 9.5.0 (#5974)
dependabot[bot] Feb 16, 2022
b043cd3
build(deps-dev): bump @babel/core from 7.17.2 to 7.17.3 (#5971)
dependabot[bot] Feb 16, 2022
cbb2393
docs(guides): clarify some caveats about dynamic import manual preloa…
artem-malko Feb 16, 2022
b081da6
build(deps): bump react-spring from 9.4.2 to 9.4.3 (#5969)
dependabot[bot] Feb 17, 2022
e9d15c5
build(deps-dev): bump sass-loader from 12.4.0 to 12.6.0 (#5973)
dependabot[bot] Feb 17, 2022
627c260
build(deps-dev): bump @babel/core from 7.17.3 to 7.17.4 (#5976)
dependabot[bot] Feb 17, 2022
805d6eb
build(deps-dev): bump webpack from 5.69.0 to 5.69.1 (#5980)
dependabot[bot] Feb 18, 2022
636d199
build(deps-dev): bump tailwindcss from 3.0.22 to 3.0.23 (#5978)
dependabot[bot] Feb 18, 2022
af70cb9
build(deps-dev): bump sass from 1.49.7 to 1.49.8 (#5981)
dependabot[bot] Feb 20, 2022
d21cfcf
build(deps-dev): bump @babel/core from 7.17.4 to 7.17.5 (#5979)
dependabot[bot] Feb 20, 2022
c9cfd74
build(deps): bump react-helmet-async from 1.2.2 to 1.2.3 (#5977)
dependabot[bot] Feb 20, 2022
b9b7a02
build(deps-dev): bump eslint-config-prettier from 8.3.0 to 8.4.0 (#5982)
dependabot[bot] Feb 23, 2022
18e03e3
build(deps-dev): bump directory-tree from 3.2.1 to 3.2.2 (#5983)
dependabot[bot] Feb 23, 2022
7b9c80f
docs(configuration): update watchOptions.aggregateTimeout default va…
vankop Feb 23, 2022
af3de6f
build(deps): bump workbox-window from 6.4.2 to 6.5.0 (#5989)
dependabot[bot] Feb 25, 2022
c3815ed
feat: use parcel css (#5959)
chenxsan Feb 25, 2022
95ccaf2
build(deps-dev): bump postcss from 8.4.6 to 8.4.7 (#5992)
dependabot[bot] Feb 27, 2022
d5c5b11
build(deps-dev): bump eslint-plugin-react from 7.28.0 to 7.29.1 (#5991)
dependabot[bot] Feb 27, 2022
014cfee
build(deps-dev): bump sass from 1.49.8 to 1.49.9 (#5990)
dependabot[bot] Feb 27, 2022
48d8ac9
build(deps-dev): bump workbox-webpack-plugin from 6.4.2 to 6.5.0 (#5988)
dependabot[bot] Feb 27, 2022
e7065ad
build(deps-dev): bump eslint from 8.9.0 to 8.10.0 (#5996)
dependabot[bot] Mar 1, 2022
432dc84
build(deps-dev): bump eslint-plugin-react from 7.29.1 to 7.29.2 (#5997)
dependabot[bot] Mar 1, 2022
3257e9f
build(deps): bump urijs from 1.19.7 to 1.19.8 (#5993)
dependabot[bot] Mar 1, 2022
36ccaec
build(deps): bump react-router-dom from 6.2.1 to 6.2.2 (#6000)
dependabot[bot] Mar 2, 2022
60a4323
build(deps-dev): bump node-fetch from 3.2.0 to 3.2.1 (#5999)
dependabot[bot] Mar 2, 2022
e7eca65
docs(configuration): document for specifying the `buildHttp.proxy` fo…
aleen42 Mar 2, 2022
fc18661
build(deps-dev): bump cypress from 9.5.0 to 9.5.1 (#5998)
dependabot[bot] Mar 3, 2022
4250c01
build(deps-dev): bump @parcel/css from 1.4.0 to 1.5.0 (#6001)
dependabot[bot] Mar 3, 2022
a75698d
build(deps): bump urijs from 1.19.8 to 1.19.9 (#6007)
dependabot[bot] Mar 4, 2022
c80599e
build(deps-dev): bump css-loader from 6.6.0 to 6.7.0 (#6011)
dependabot[bot] Mar 5, 2022
49b782a
fix Vote page (#6017)
chenxsan Mar 5, 2022
230db8c
build(deps-dev): bump eslint-plugin-react from 7.29.2 to 7.29.3 (#6012)
dependabot[bot] Mar 6, 2022
c7920e1
build(deps-dev): bump eslint-config-prettier from 8.4.0 to 8.5.0 (#6006)
dependabot[bot] Mar 8, 2022
c81b4c4
build(deps-dev): bump webpack from 5.69.1 to 5.70.0 (#6005)
dependabot[bot] Mar 8, 2022
2f13e11
build(deps-dev): bump css-loader from 6.7.0 to 6.7.1 (#6024)
dependabot[bot] Mar 8, 2022
c33a261
build(deps-dev): bump postcss from 8.4.7 to 8.4.8 (#6023)
dependabot[bot] Mar 8, 2022
17ff164
build(deps-dev): bump workbox-webpack-plugin from 6.5.0 to 6.5.1 (#6010)
dependabot[bot] Mar 9, 2022
dc50221
build(deps): bump workbox-window from 6.5.0 to 6.5.1 (#6013)
dependabot[bot] Mar 9, 2022
d28d210
build(deps-dev): bump @parcel/css from 1.5.0 to 1.6.0 (#6027)
dependabot[bot] Mar 11, 2022
ff4987c
docs(api) : Remove `sortItemsWithModuleIds` (#6019)
jeffin143 Mar 11, 2022
e2738d9
build(deps-dev): bump node-fetch from 3.2.1 to 3.2.2 (#6020)
dependabot[bot] Mar 11, 2022
12ace31
build(deps): bump urijs from 1.19.9 to 1.19.10 (#6026)
dependabot[bot] Mar 11, 2022
c9f1357
build(deps-dev): bump mini-css-extract-plugin from 2.5.3 to 2.6.0 (#6…
dependabot[bot] Mar 11, 2022
e45458e
build(deps-dev): bump lint-staged from 12.3.4 to 12.3.5 (#6021)
dependabot[bot] Mar 11, 2022
0fd0ff3
build(deps): bump react-spring from 9.4.3 to 9.4.4 (#6031)
dependabot[bot] Mar 12, 2022
92fcbb3
docs: add import.meta.webpackContext (#6029)
ersachin3112 Mar 12, 2022
d73d1b0
docs: add parserOptions.importMetaContext (#6028)
ersachin3112 Mar 12, 2022
08f730e
docs(configuration): fix typo (#6032)
1ilsang Mar 14, 2022
2fa5192
build(deps-dev): bump eslint-plugin-react from 7.29.3 to 7.29.4 (#6036)
dependabot[bot] Mar 15, 2022
5eb6fca
build(deps-dev): bump node-fetch from 3.2.2 to 3.2.3 (#6033)
dependabot[bot] Mar 17, 2022
cac5270
build(deps-dev): bump postcss from 8.4.8 to 8.4.12 (#6041)
dependabot[bot] Mar 17, 2022
f9c89d9
build(deps-dev): bump lint-staged from 12.3.5 to 12.3.6 (#6045)
dependabot[bot] Mar 17, 2022
3f21cb7
build(deps-dev): bump prettier from 2.5.1 to 2.6.0 (#6042)
dependabot[bot] Mar 17, 2022
9fb794d
build(deps-dev): bump lint-staged from 12.3.6 to 12.3.7 (#6046)
dependabot[bot] Mar 18, 2022
d83cdb8
build(deps-dev): bump autoprefixer from 10.4.2 to 10.4.4 (#6043)
dependabot[bot] Mar 18, 2022
059998b
chore: replace deprecated String.prototype.substr() (#6047)
CommanderRoot Mar 18, 2022
f4183cf
build(deps-dev): bump cypress from 9.5.1 to 9.5.2 (#6039)
dependabot[bot] Mar 18, 2022
03da523
build(deps-dev): bump eslint from 8.10.0 to 8.11.0 (#6035)
dependabot[bot] Mar 18, 2022
26145a0
build(deps-dev): bump @babel/core from 7.17.5 to 7.17.7 (#6034)
dependabot[bot] Mar 20, 2022
2fb01c9
docs: add disclaimer for third-party packages (#6049)
chenxsan Mar 21, 2022
e77d66e
build(deps-dev): bump eslint-plugin-mdx from 1.16.0 to 1.17.0 (#6052)
dependabot[bot] Mar 22, 2022
0ae61c5
build(deps-dev): bump @babel/core from 7.17.7 to 7.17.8 (#6051)
dependabot[bot] Mar 22, 2022
bf79b4d
build(deps-dev): bump @parcel/css from 1.6.0 to 1.7.1 (#6050)
dependabot[bot] Mar 22, 2022
2c3edce
docs(migrate): update of splitChunks.cacheGroups.test() (#6022)
gkostov Mar 22, 2022
cdf0156
docs(config) : Change default value output.globalObject (#6025)
jeffin143 Mar 22, 2022
0a6ed84
build(deps-dev): bump babel-loader from 8.2.3 to 8.2.4 (#6053)
dependabot[bot] Mar 23, 2022
edf7afd
build(deps-dev): bump @parcel/css from 1.7.1 to 1.7.2 (#6054)
dependabot[bot] Mar 23, 2022
6698d5c
build(deps): bump node-forge from 1.2.0 to 1.3.0 (#6055)
dependabot[bot] Mar 23, 2022
0fdfbf5
docs(api): udpate description for `--force` option (#6061)
snitin315 Mar 25, 2022
f514c7d
build(deps-dev): bump eslint from 8.11.0 to 8.12.0 (#6065)
dependabot[bot] Mar 29, 2022
d73c114
build(deps-dev): bump prettier from 2.6.0 to 2.6.1 (#6062)
dependabot[bot] Mar 29, 2022
d6a6ced
Update action files (#6066)
chenxsan Mar 29, 2022
fb83a9e
build(deps-dev): bump workbox-webpack-plugin from 6.5.1 to 6.5.2 (#6059)
dependabot[bot] Mar 29, 2022
3b45977
build(deps): bump workbox-window from 6.5.1 to 6.5.2 (#6060)
dependabot[bot] Mar 29, 2022
5744be7
build(deps-dev): bump react-refresh from 0.11.0 to 0.12.0 (#6069)
dependabot[bot] Mar 30, 2022
785589b
build(deps-dev): bump cypress from 9.5.2 to 9.5.3 (#6067)
dependabot[bot] Mar 30, 2022
a6cb954
build(deps-dev): bump eslint-plugin-react-hooks from 4.3.0 to 4.4.0 (…
dependabot[bot] Mar 30, 2022
831b841
build(deps-dev): bump @parcel/css from 1.7.2 to 1.7.3 (#6058)
dependabot[bot] Mar 30, 2022
195dfee
build(deps): bump react-router-dom from 6.2.2 to 6.3.0 (#6076)
dependabot[bot] Apr 2, 2022
12b6a39
build(deps-dev): bump webpack from 5.70.0 to 5.71.0 (#6075)
dependabot[bot] Apr 2, 2022
12796ee
build(deps-dev): bump sass from 1.49.9 to 1.49.10 (#6072)
dependabot[bot] Apr 2, 2022
eb2c705
docs(en): merging all conflicts
docschina-bot Apr 2, 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: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
node-version: [16.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
Expand All @@ -31,7 +31,7 @@ jobs:
- run: yarn lint:links

- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.1.8
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
node-version: [16.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
Expand All @@ -31,7 +31,7 @@ jobs:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Vale
uses: errata-ai/vale-action@v1.4.2
Expand All @@ -48,10 +48,10 @@ jobs:
node-version: [16.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
Expand All @@ -72,10 +72,10 @@ jobs:
node-version: [16.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
Expand Down
64 changes: 37 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,53 +73,64 @@
]
},
"devDependencies": {
"@babel/core": "^7.17.0",
"@babel/core": "^7.17.8",
"@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",
"@mdx-js/loader": "^2.0.0-next.9",
"@octokit/auth-action": "^1.3.3",
"@octokit/rest": "^18.12.0",
"@parcel/css": "^1.7.3",
"@pmmmwh/react-refresh-webpack-plugin": "next",
"@svgr/webpack": "^6.2.1",
"autoprefixer": "^10.4.2",
"babel-loader": "^8.2.3",
"autoprefixer": "^10.4.4",
"babel-loader": "^8.2.4",
"copy-webpack-plugin": "^10.2.4",
"css-loader": "^6.6.0",
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^3.4.1",
"cypress": "^9.4.1",
"directory-tree": "^3.1.0",
"cypress": "^9.5.3",
"directory-tree": "^3.2.2",
"directory-tree-webpack-plugin": "^1.0.3",
"duplexer": "^0.1.1",
"eslint": "^8.8.0",
"eslint-config-prettier": "^8.3.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-mdx": "^1.16.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-mdx": "^1.17.0",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
"front-matter": "^4.0.2",
<<<<<<< HEAD
"github-slugger": "^1.3.0",
"html-loader": "^2.1.2",
=======
"github-slugger": "^1.4.0",
>>>>>>> 12796ee6fa189e23ce9d0b9d9fec3f53bf4a1b33
"html-webpack-plugin": "^5.5.0",
"http-server": "^14.1.0",
"husky": "^7.0.4",
"hyperlink": "^5.0.4",
"jest": "^27.5.0",
"lint-staged": "^12.3.3",
"jest": "^27.5.1",
"lint-staged": "^12.3.7",
"lodash": "^4.17.21",
"markdownlint": "^0.25.1",
<<<<<<< HEAD
"markdownlint-cli": "^0.31.0",
"mdast-util-to-string": "^1.1.0",
"mini-css-extract-plugin": "^2.5.3",
=======
"markdownlint-cli": "^0.31.1",
"mdast-util-to-string": "^3.1.0",
"mini-css-extract-plugin": "^2.6.0",
>>>>>>> 12796ee6fa189e23ce9d0b9d9fec3f53bf4a1b33
"mkdirp": "^1.0.4",
"modularscale-sass": "^3.0.3",
"node-fetch": "^3.2.0",
"node-fetch": "^3.2.3",
"npm-run-all": "^4.1.1",
"postcss": "^8.4.6",
"postcss": "^8.4.12",
"postcss-loader": "^6.2.1",
"prettier": "^2.5.1",
"react-refresh": "^0.11.0",
"prettier": "^2.6.1",
"react-refresh": "^0.12.0",
"redirect-webpack-plugin": "^1.0.0",
"remark": "^14.0.2",
"remark-autolink-headings": "7.0.1",
Expand All @@ -129,42 +140,41 @@
"remark-gfm": "^1.0.0",
"remark-html": "^15.0.1",
"remark-refractor": "montogeek/remark-refractor",
"remark-slug": "^7.0.1",
"rimraf": "^3.0.2",
"sass": "^1.49.7",
"sass-loader": "^12.4.0",
"sass": "^1.49.10",
"sass-loader": "^12.6.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.18",
"tailwindcss": "^3.0.23",
"tap-spot": "^1.1.1",
"textlint": "^11.8.2",
"textlint-rule-heading": "^1.0.10",
"unist-util-visit": "^4.1.0",
"webpack": "^5.68.0",
"webpack": "^5.71.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4",
"webpack-merge": "^5.8.0",
"workbox-webpack-plugin": "^6.4.2"
"workbox-webpack-plugin": "^6.5.2"
},
"dependencies": {
"@docsearch/react": "^3.0.0-alpha.50",
"path-browserify": "^1.0.1",
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-helmet-async": "^1.2.2",
"react-router-dom": "^6.2.1",
"react-spring": "^9.4.2",
"react-helmet-async": "^1.2.3",
"react-router-dom": "^6.3.0",
"react-spring": "^9.4.4",
"react-tiny-popover": "5",
"react-use": "^17.3.2",
"react-visibility-sensor": "^5.0.2",
"webpack-pwa-manifest": "^4.3.0",
"webpack.vote": "https://github.com/webpack/voting-app.git",
"workbox-window": "^6.4.2"
"workbox-window": "^6.5.2"
},
"resolutions": {
"sitemap-static/minimist": "1.2.5",
Expand Down
11 changes: 6 additions & 5 deletions src/components/Markdown/Markdown.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use "sass:color";
@use 'sass:color';
@import 'vars';
@import 'functions';
@import 'prism-theme';
Expand Down Expand Up @@ -41,15 +41,16 @@ $topHeightMobileWithBanner: $bannerHeight + $topHeightMobile;
h4,
h5,
h6 {
&:before {
content: '';
> span[id] {
position: absolute;
width: 0;
display: block;
visibility: hidden;
pointer-events: none;
height: $topHeightMobile;
padding-top: $topHeightMobile;
margin-top: -#{$topHeightMobile};
@include break {
height: $topHeightDesktop;
padding-top: $topHeightDesktop;
margin-top: -#{$topHeightDesktop};
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/components/Page/Page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ export default function Page(props) {
<Markdown>
<h1>{title}</h1>

{rest.thirdParty ? (
<div className="italic my-[20px]">
<strong className="font-bold">Disclaimer:</strong> {title} is a
third-party package maintained by community members, it potentially
does not have the same support, security policy or license as
webpack, and it is not maintained by webpack.
</div>
) : null}

{contentRender}

{loadRelated && (
Expand Down
6 changes: 6 additions & 0 deletions src/components/Site/Site.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,16 @@ function Site(props) {
)
),
},
<<<<<<< HEAD
{ content: '参与贡献', url: '/contribute/' },
{ content: '投票', url: 'https://v4.webpack.docschina.org/vote/' },
{ content: '博客', url: '/blog/' },
{ content: '印记中文', url: 'https://docschina.org' },
=======
{ content: 'Contribute', url: '/contribute/' },
{ content: 'Vote', url: '/vote/' },
{ content: 'Blog', url: '/blog/' },
>>>>>>> 12796ee6fa189e23ce9d0b9d9fec3f53bf4a1b33
]}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Support/Support.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function formatMoney(number) {
let str = Math.round(number) + '';

if (str.length > 3) {
str = str.substr(0, str.length - 3) + ',' + str.substr(-3);
str = str.slice(0, -3) + ',' + str.slice(-3);
}
return str;
}
Expand Down
12 changes: 12 additions & 0 deletions src/content/api/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ npx webpack init ./my-app --force --template=default

`boolean`

<<<<<<< HEAD
生成项目时不启用选项模式。当为 `true` 时,所有命令行选项使用默认值。
=======
To generate a project without questions. When enabled, the default answer for each question will be used.
>>>>>>> 12796ee6fa189e23ce9d0b9d9fec3f53bf4a1b33

T> 点击 [这里](https://github.com/webpack/webpack-cli/blob/master/packages/generators/INIT.md) 获取 `webpack init` 命令的完整文档。

Expand Down Expand Up @@ -581,11 +585,19 @@ T> 请查阅 [environment 变量指南](/guides/environment-variables/)了解更

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

<<<<<<< HEAD
| 变量名 | 描述 |
| --------------- | --------------------------------------------- |
| `WEBPACK_SERVE` | 如果使用了 `serve\|s`,则为 `true`。 |
| `WEBPACK_BUILD` | 如果使用了 `build\|bundle\|b`,则为 `true`。 |
| `WEBPACK_WATCH` | 如果使用了 `--watch\|watch\|w`,则为 `true`。 |
=======
| Environment Variable | Description |
| -------------------- | -------------------------------------------- |
| `WEBPACK_SERVE` | `true` if `serve\|server\|s` is being used. |
| `WEBPACK_BUILD` | `true` if `build\|bundle\|b` is being used. |
| `WEBPACK_WATCH` | `true` if `--watch\|watch\|w` is being used. |
>>>>>>> 12796ee6fa189e23ce9d0b9d9fec3f53bf4a1b33

请注意你不能在 bundle 代码中使用这些内置环境变量。

Expand Down
4 changes: 4 additions & 0 deletions src/content/api/compilation-object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,15 @@ Compilation 对象有很多可用的方法和钩子。在此页面,我们将
- `block` - `Chunk` 的块连接。
- `chunk` - 从依赖中删除的块。

<<<<<<< HEAD
### sortItemsWithModuleIds $#sortitemswithmoduleids$

`function`

### sortItemsWithChunkIds $#sortitemswithchunkids$
=======
### sortItemsWithChunkIds
>>>>>>> 12796ee6fa189e23ce9d0b9d9fec3f53bf4a1b33

`function`

Expand Down
38 changes: 38 additions & 0 deletions src/content/api/module-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,45 @@ console.log(import.meta.webpack); // output `5` for webpack 5

webpack 特定。[`module.hot`](#modulehot-webpack-specific) 的一个别名,[strict ESM](/guides/ecma-script-modules/#flagging-modules-as-esm) 中可以使用 `import.meta.webpackHot` 但是不能使用 `module.hot`。

<<<<<<< HEAD
## \_\_filename (NodeJS) $#__filename-nodejs$
=======
## import.meta.webpackContext

Returns the same value as `require.context` but only for `javascript/auto` and `javascript/esm`.

- Type:

```ts
(
request: string,
options?: {
recursive?: boolean;
regExp?: RegExp;
include?: RegExp;
exclude?: RegExp;
preload?: boolean | number;
prefetch?: boolean | number;
chunkName?: string;
exports?: string | string[][];
mode?: 'sync' | 'eager' | 'weak' | 'lazy' | 'lazy-once';
}
) => webpack.Context;
```

- Available: 5.70.0+
- Example:
```js
const contextRequire = import.meta.webpackContext('.', {
recursive: false,
regExp: /two/,
mode: 'weak',
exclude: /three/,
});
```

## \_\_filename (NodeJS)
>>>>>>> 12796ee6fa189e23ce9d0b9d9fec3f53bf4a1b33

取决于 `node.__filename` 配置选项:

Expand Down
4 changes: 4 additions & 0 deletions src/content/configuration/dev-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,11 @@ npx webpack serve --port auto

当拥有单独的 API 后端开发服务器并且希望在同一域上发送 API 请求时,代理某些 URL 可能会很有用。

<<<<<<< HEAD
开发服务器使用功能强大的 [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) 软件包。 查看其 [documentation](https://github.com/chimurai/http-proxy-middleware#options) 了解更多高级用法。 请注意,`http-proxy-middleware` 的某些功能不需要`target`键,例如 它的 `router` 功能,但是仍然需要在此处的配置中包含`target`,否则`webpack-dev-server` 不会将其传递给 `http-proxy-middleware`)。
=======
The dev-server makes use of the powerful [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) package. Check out its [documentation](https://github.com/chimurai/http-proxy-middleware#options) for more advanced usages. Note that some of `http-proxy-middleware`'s features do not require a `target` key, e.g. its `router` feature, but you will still need to include a `target` key in your configuration here, otherwise `webpack-dev-server` won't pass it along to `http-proxy-middleware`.
>>>>>>> 12796ee6fa189e23ce9d0b9d9fec3f53bf4a1b33

使用后端在 `localhost:3000` 上,可以使用它来启用代理:

Expand Down
12 changes: 12 additions & 0 deletions src/content/configuration/experiments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,19 @@ Define the location to store the lockfile.

By default webpack would generate a `<compiler-name.>webpack.lock` file>. Make sure to commit it into a version control system. During the `production` build, webpack will build those modules beginning with `http(s):` protocol from the lockfile and caches under [`experiments.buildHttp.cacheLocation`](#experimentsbuildhttpcachelocation).

<<<<<<< HEAD
#### experiments.buildHttp.upgrade $#experimentsbuildhttpupgrade$
=======
#### experiments.buildHttp.proxy

Specify the proxy server to use for fetching remote resources.

- Type: `string`

By default, Webpack would imply the proxy server to use for fetching remote resources from the `http_proxy` (case insensitive) environment variable. However, you can also specify one through the `proxy` option.

#### experiments.buildHttp.upgrade
>>>>>>> 12796ee6fa189e23ce9d0b9d9fec3f53bf4a1b33

Detect changes to remote resources and upgrade them automatically.

Expand Down
Loading