Skip to content

Commit 115d876

Browse files
authored
Merge pull request #1528 from docschina/sync-f61d17e8
docs(en): merge webpack.js.org/master into webpack.js.org/cn @ f61d17e
2 parents 653f2dc + 80c8cd3 commit 115d876

File tree

3 files changed

+100
-60
lines changed

3 files changed

+100
-60
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"@mdx-js/loader": "^2.0.0-next.9",
8282
"@octokit/auth-action": "^1.3.3",
8383
"@octokit/rest": "^18.12.0",
84-
"@parcel/css": "^1.7.4",
84+
"@parcel/css": "^1.8.0",
8585
"@pmmmwh/react-refresh-webpack-plugin": "next",
8686
"@svgr/webpack": "^6.2.1",
8787
"autoprefixer": "^10.4.4",
@@ -119,7 +119,7 @@
119119
"npm-run-all": "^4.1.1",
120120
"postcss": "^8.4.12",
121121
"postcss-loader": "^6.2.1",
122-
"prettier": "^2.6.1",
122+
"prettier": "^2.6.2",
123123
"react-refresh": "^0.12.0",
124124
"redirect-webpack-plugin": "^1.0.0",
125125
"remark": "^14.0.2",
@@ -131,7 +131,7 @@
131131
"remark-html": "^15.0.1",
132132
"remark-refractor": "montogeek/remark-refractor",
133133
"rimraf": "^3.0.2",
134-
"sass": "^1.49.10",
134+
"sass": "^1.50.0",
135135
"sass-loader": "^12.6.0",
136136
"sirv-cli": "^2.0.2",
137137
"sitemap-static": "^0.4.2",
@@ -143,7 +143,7 @@
143143
"textlint": "^11.8.2",
144144
"textlint-rule-heading": "^1.0.10",
145145
"unist-util-visit": "^4.1.0",
146-
"webpack": "^5.71.0",
146+
"webpack": "^5.72.0",
147147
"webpack-bundle-analyzer": "^4.5.0",
148148
"webpack-cli": "^4.9.2",
149149
"webpack-dev-server": "^4.7.4",

src/content/configuration/cache.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,3 +442,43 @@ module.exports = {
442442
```
443443

444444
W> 在具有不同选项的调用之间不要共享缓存。
445+
446+
## 在 CI/CD 系统中设置缓存 $#setup-cache-in-cicd-system$
447+
448+
文件系统缓存允许在 CI 的构建之间共享缓存。为了设置设置缓存:
449+
450+
- CI 应该有一个在构建之间共享缓存的配置项。
451+
- CI 应该在相同的绝对路径中运行任务。这非常重要,因为 webpack 缓存文件存储绝对路径。
452+
453+
### GitLab CI/CD
454+
455+
以下是一些通用配置
456+
457+
```yaml
458+
variables:
459+
# 兜底使用 "main" 分支缓存,要求 GitLab Runner 版本为 13.4
460+
CACHE_FALLBACK_KEY: main
461+
462+
# 这是 webpack 构建任务
463+
build-job:
464+
cache:
465+
key: '$CI_COMMIT_REF_SLUG' # 分支/tag 名称
466+
paths:
467+
# 缓存文件夹
468+
# 确保在这个任务中没有运行 "npm ci" 或者更改默认缓存文件夹
469+
# 否则 "npm ci" 将会删除缓存文件
470+
- node_modules/.cache/webpack/
471+
```
472+
473+
### Github actions
474+
475+
```yaml
476+
- uses: actions/cache@v3
477+
with:
478+
# 缓存文件夹
479+
path: node_modules/.cache/webpack/
480+
key: ${{ GITHUB_REF_NAME }}-webpack-build
481+
# 兜底使用 "main" 分支缓存
482+
restore-keys: |
483+
main-webpack-build
484+
```

yarn.lock

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,61 +2073,61 @@
20732073
dependencies:
20742074
"@octokit/openapi-types" "^11.1.0"
20752075

2076-
"@parcel/css-darwin-arm64@1.7.4":
2077-
version "1.7.4"
2078-
resolved "https://registry.yarnpkg.com/@parcel/css-darwin-arm64/-/css-darwin-arm64-1.7.4.tgz#9d173f8d9a3f6dec34e49999654ba091121f1f22"
2079-
integrity sha512-fA+aBZAAgXSV7jUQFRYuKpJr5EEqNq++mFu4o/pU/lBFMJhL6Z11aqzrBecC1JziWT3t/BgryWdznf1QkNtM4w==
2076+
"@parcel/css-darwin-arm64@1.8.0":
2077+
version "1.8.0"
2078+
resolved "https://registry.yarnpkg.com/@parcel/css-darwin-arm64/-/css-darwin-arm64-1.8.0.tgz#88e08835351a55015c68be6e45a2d94d3a32946b"
2079+
integrity sha512-A9taXLx12UTgyH/UGD9KMDNTXmLuH51h5g+AV4ZVo8vUZHSofP/Sb+zphOikdHn+K5gzVai1a06N92F2G8xJGw==
20802080

2081-
"@parcel/css-darwin-x64@1.7.4":
2082-
version "1.7.4"
2083-
resolved "https://registry.yarnpkg.com/@parcel/css-darwin-x64/-/css-darwin-x64-1.7.4.tgz#e36f8a4c941c9059d6fc96e1f52c8022f04c32ef"
2084-
integrity sha512-qx/+vEXSmed7eeBgVvV/1lrEjk8KnKUiAN+CCes8d6ddJJzK5evTKQsWkywe1jNdHC33d2mlLlhLFmC2+2IPOw==
2081+
"@parcel/css-darwin-x64@1.8.0":
2082+
version "1.8.0"
2083+
resolved "https://registry.yarnpkg.com/@parcel/css-darwin-x64/-/css-darwin-x64-1.8.0.tgz#85dc8d81f011c1d8d6f0152804664d0212d24e45"
2084+
integrity sha512-SWmB7fnD0USm9AHZBHx9EJBo1c2dwLFuA/HBD3in4yDPGS5kSqfIJTfux3NO/aySsy7NAC3FOgK/L2A2PdtpGQ==
20852085

2086-
"@parcel/css-linux-arm-gnueabihf@1.7.4":
2087-
version "1.7.4"
2088-
resolved "https://registry.yarnpkg.com/@parcel/css-linux-arm-gnueabihf/-/css-linux-arm-gnueabihf-1.7.4.tgz#783407f8179164e6555c9498436bc0e8d1c6c4e3"
2089-
integrity sha512-+Qf+j8dqJ+t7V/w9LnyWBzNcMG/GnlzjlWNQhiUkt1aYFYPr5i/eRWuWLYxVlz8EGQOUbYlinDGLXTUJDt31gA==
2086+
"@parcel/css-linux-arm-gnueabihf@1.8.0":
2087+
version "1.8.0"
2088+
resolved "https://registry.yarnpkg.com/@parcel/css-linux-arm-gnueabihf/-/css-linux-arm-gnueabihf-1.8.0.tgz#7b066a8f908d5d9ead76f1aeb252a989674f15d5"
2089+
integrity sha512-66ACZD3bnotyLAgJ/D93R28ipFomvxlsMszxv+U45GiSLBwmjKZ7VkTnMHC2/kmQ0NVdlUKh4WqjL/PB4PLkzg==
20902090

2091-
"@parcel/css-linux-arm64-gnu@1.7.4":
2092-
version "1.7.4"
2093-
resolved "https://registry.yarnpkg.com/@parcel/css-linux-arm64-gnu/-/css-linux-arm64-gnu-1.7.4.tgz#34ed91540fe31001a835f7f5dfc86c90419fb2db"
2094-
integrity sha512-ITP0HZT/Ay6JCgH3W7JpoRUYfciW+jBVBTjglZjYgyYPLLWk2J1kXB+qC3jHp5XCeH4feh7eFB1pyQcE7kqCjA==
2091+
"@parcel/css-linux-arm64-gnu@1.8.0":
2092+
version "1.8.0"
2093+
resolved "https://registry.yarnpkg.com/@parcel/css-linux-arm64-gnu/-/css-linux-arm64-gnu-1.8.0.tgz#aa2546d026158c59a888394efc4a1578470a789c"
2094+
integrity sha512-oH00san3byQnx2dWp6gsIvbZNonSQ1S+nNsTLjA/Riy2sVYTxYDsLOiNS+ryJwBKchOYSZ5PiMDgJaw7KmgIgg==
20952095

2096-
"@parcel/css-linux-arm64-musl@1.7.4":
2097-
version "1.7.4"
2098-
resolved "https://registry.yarnpkg.com/@parcel/css-linux-arm64-musl/-/css-linux-arm64-musl-1.7.4.tgz#3937fdadb0581e96b9f76a37713241b35a3250fa"
2099-
integrity sha512-or61QRhhpsDlHfrc73KP4bPwnnVZWni1jkuRv1mCi+0SzYzoaO190JEaj7VWh/boUvjGiIl//FsLoZleQIWKNA==
2096+
"@parcel/css-linux-arm64-musl@1.8.0":
2097+
version "1.8.0"
2098+
resolved "https://registry.yarnpkg.com/@parcel/css-linux-arm64-musl/-/css-linux-arm64-musl-1.8.0.tgz#233f985948433126efca3ddb974296f1f7520701"
2099+
integrity sha512-0p0AJ3QypEC0NwFWbzy5JbI8ZDLUED3BGXvqdD7jfOx14qCW2apq7OKBSwSCS8ZvBo8G2tkss7nbyOG5NbIjUQ==
21002100

2101-
"@parcel/css-linux-x64-gnu@1.7.4":
2102-
version "1.7.4"
2103-
resolved "https://registry.yarnpkg.com/@parcel/css-linux-x64-gnu/-/css-linux-x64-gnu-1.7.4.tgz#ee883af8a97b99519c581cb2971c414e962a6ae1"
2104-
integrity sha512-GHGsM06F26FAkvPcnsGw7NHxPVD7TQvg7OC7cVAYmETccO8mqs9DyRzBTevk+1kl7EQXNnHDojn7VpVN6q+phg==
2101+
"@parcel/css-linux-x64-gnu@1.8.0":
2102+
version "1.8.0"
2103+
resolved "https://registry.yarnpkg.com/@parcel/css-linux-x64-gnu/-/css-linux-x64-gnu-1.8.0.tgz#2b3262950e2ce2721facee150a99b2a620bef536"
2104+
integrity sha512-nXWRN7LSXZPic0B8F77AQe7CIqYi4+nD5QVpABX0j7s/UO2BAcfN0vpI0CNAuErX4QOSs3AIWo1XF0qL/mH9DQ==
21052105

2106-
"@parcel/css-linux-x64-musl@1.7.4":
2107-
version "1.7.4"
2108-
resolved "https://registry.yarnpkg.com/@parcel/css-linux-x64-musl/-/css-linux-x64-musl-1.7.4.tgz#fd14e88683026665543bc48dee138edc553fcf75"
2109-
integrity sha512-H/9wvQ7LNqng9yIwulpfUUhs6zm9+vLCzri2qnC4vm8geyTjA0W0H5fphV8IlzNJ/DfHmoesJ+TXw5NG+QC9hg==
2106+
"@parcel/css-linux-x64-musl@1.8.0":
2107+
version "1.8.0"
2108+
resolved "https://registry.yarnpkg.com/@parcel/css-linux-x64-musl/-/css-linux-x64-musl-1.8.0.tgz#f8839f56eac201a3a58f15308e5a334700a49d52"
2109+
integrity sha512-5Q5SQREh1tSOjvIu55acqEzWDdZJZiwlgdoC8nTYmIRsyFn4SVibVMDau5qWmb3Xtswr/hm41xesG3nIBXCX+Q==
21102110

2111-
"@parcel/css-win32-x64-msvc@1.7.4":
2112-
version "1.7.4"
2113-
resolved "https://registry.yarnpkg.com/@parcel/css-win32-x64-msvc/-/css-win32-x64-msvc-1.7.4.tgz#ed6dfb63600610ba555124262d84fa537ee7e6a4"
2114-
integrity sha512-xmg18iISCn1f9IyYUif6yR8FuEmi93qzH55oUiri5vZWuCY8xfraHsRA6i8yLWnxgDmVeHyiN0IICl7rgZo10A==
2111+
"@parcel/css-win32-x64-msvc@1.8.0":
2112+
version "1.8.0"
2113+
resolved "https://registry.yarnpkg.com/@parcel/css-win32-x64-msvc/-/css-win32-x64-msvc-1.8.0.tgz#928fe074c48cf72d3349d9042f604b268041eb8a"
2114+
integrity sha512-IHFRdgsLHUuXIREtnRE/yNjNyRofySyLvG4lx8sfbBYQFIdelplw6V74kQ/u2iNt4MIOP69CkJxUuF+uX//ooQ==
21152115

2116-
"@parcel/css@^1.7.4":
2117-
version "1.7.4"
2118-
resolved "https://registry.yarnpkg.com/@parcel/css/-/css-1.7.4.tgz#87b522681a5527ad38baec4193a26a94fde37a5e"
2119-
integrity sha512-K1N9mxEkWQQmSINMNuGvlyPq7yCY+AtHskGxWav97lhu2i8GMMXRV9kc8/x/jkZh5KDBWO5vHhdQiujRBrgR8g==
2116+
"@parcel/css@^1.8.0":
2117+
version "1.8.0"
2118+
resolved "https://registry.yarnpkg.com/@parcel/css/-/css-1.8.0.tgz#bd5773e2e695d970cab1cfceb9926bb461d8db64"
2119+
integrity sha512-l6+gGOIk+JEZ+RuqsGzl4yDFKfSC8Uq+FaHzJgwIuIcdHip8ENMr8HMHiOPeO3VSo1JRn3yt5+MIntm2GIzAIA==
21202120
dependencies:
21212121
detect-libc "^1.0.3"
21222122
optionalDependencies:
2123-
"@parcel/css-darwin-arm64" "1.7.4"
2124-
"@parcel/css-darwin-x64" "1.7.4"
2125-
"@parcel/css-linux-arm-gnueabihf" "1.7.4"
2126-
"@parcel/css-linux-arm64-gnu" "1.7.4"
2127-
"@parcel/css-linux-arm64-musl" "1.7.4"
2128-
"@parcel/css-linux-x64-gnu" "1.7.4"
2129-
"@parcel/css-linux-x64-musl" "1.7.4"
2130-
"@parcel/css-win32-x64-msvc" "1.7.4"
2123+
"@parcel/css-darwin-arm64" "1.8.0"
2124+
"@parcel/css-darwin-x64" "1.8.0"
2125+
"@parcel/css-linux-arm-gnueabihf" "1.8.0"
2126+
"@parcel/css-linux-arm64-gnu" "1.8.0"
2127+
"@parcel/css-linux-arm64-musl" "1.8.0"
2128+
"@parcel/css-linux-x64-gnu" "1.8.0"
2129+
"@parcel/css-linux-x64-musl" "1.8.0"
2130+
"@parcel/css-win32-x64-msvc" "1.8.0"
21312131

21322132
"@pmmmwh/react-refresh-webpack-plugin@next":
21332133
version "0.5.5"
@@ -10379,10 +10379,10 @@ prelude-ls@~1.1.2:
1037910379
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
1038010380
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
1038110381

10382-
prettier@^2.6.1:
10383-
version "2.6.1"
10384-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.1.tgz#d472797e0d7461605c1609808e27b80c0f9cfe17"
10385-
integrity sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==
10382+
prettier@^2.6.2:
10383+
version "2.6.2"
10384+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032"
10385+
integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==
1038610386

1038710387
pretty-bytes@^5.1.0, pretty-bytes@^5.2.0, pretty-bytes@^5.3.0, pretty-bytes@^5.4.1, pretty-bytes@^5.6.0:
1038810388
version "5.6.0"
@@ -11313,10 +11313,10 @@ sass-loader@^12.6.0:
1131311313
klona "^2.0.4"
1131411314
neo-async "^2.6.2"
1131511315

11316-
sass@^1.49.10:
11317-
version "1.49.10"
11318-
resolved "https://registry.yarnpkg.com/sass/-/sass-1.49.10.tgz#7b83cee0f03bbba443111b3f94944fde2b0c7a6b"
11319-
integrity sha512-w37zfWJwKu4I78U4z63u1mmgoncq+v3iOB4yzQMPyAPVHHawaQSnu9C9ysGQnZEhW609jkcLioJcMCqm75JMdg==
11316+
sass@^1.50.0:
11317+
version "1.50.0"
11318+
resolved "https://registry.yarnpkg.com/sass/-/sass-1.50.0.tgz#3e407e2ebc53b12f1e35ce45efb226ea6063c7c8"
11319+
integrity sha512-cLsD6MEZ5URXHStxApajEh7gW189kkjn4Rc8DQweMyF+o5HF5nfEz8QYLMlPsTOD88DknatTmBWkOcw5/LnJLQ==
1132011320
dependencies:
1132111321
chokidar ">=3.0.0 <4.0.0"
1132211322
immutable "^4.0.0"
@@ -13448,10 +13448,10 @@ webpack-sources@^3.2.3:
1344813448
react-textarea-autosize "^5.2.1"
1344913449
uuid "^3.1.0"
1345013450

13451-
webpack@^5.71.0:
13452-
version "5.71.0"
13453-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.71.0.tgz#b01fcf379570b8c5ee06ca06c829ca168c951884"
13454-
integrity sha512-g4dFT7CFG8LY0iU5G8nBL6VlkT21Z7dcYDpJAEJV5Q1WLb9UwnFbrem1k7K52ILqEmomN7pnzWFxxE6SlDY56A==
13451+
webpack@^5.72.0:
13452+
version "5.72.0"
13453+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.72.0.tgz#f8bc40d9c6bb489a4b7a8a685101d6022b8b6e28"
13454+
integrity sha512-qmSmbspI0Qo5ld49htys8GY9XhS9CGqFoHTsOVAnjBdg0Zn79y135R+k4IR4rKK6+eKaabMhJwiVB7xw0SJu5w==
1345513455
dependencies:
1345613456
"@types/eslint-scope" "^3.7.3"
1345713457
"@types/estree" "^0.0.51"

0 commit comments

Comments
 (0)