Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@
"@octokit/auth-action": "^1.3.3",
"@octokit/rest": "^18.12.0",
"@pmmmwh/react-refresh-webpack-plugin": "next",
"@svgr/webpack": "^6.2.0",
"@svgr/webpack": "^6.2.1",
"autoprefixer": "^10.4.2",
"babel-loader": "^8.2.3",
"copy-webpack-plugin": "^10.2.1",
"copy-webpack-plugin": "^10.2.4",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^3.4.1",
"cypress": "^9.3.1",
"directory-tree": "^3.0.1",
"directory-tree-webpack-plugin": "^1.0.3",
"duplexer": "^0.1.1",
"eslint": "^8.7.0",
"eslint": "^8.8.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-mdx": "^1.16.0",
Expand Down Expand Up @@ -138,12 +138,12 @@
"start-server-and-test": "^1.14.0",
"static-site-generator-webpack-plugin": "^3.4.1",
"style-loader": "^3.3.1",
"tailwindcss": "^3.0.17",
"tailwindcss": "^3.0.18",
"tap-spot": "^1.1.1",
"textlint": "^11.8.2",
"textlint-rule-heading": "^1.0.10",
"unist-util-visit": "^4.1.0",
"webpack": "^5.67.0",
"webpack": "^5.68.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.3",
Expand Down
6 changes: 6 additions & 0 deletions src/content/concepts/loaders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ module.exports = {
- [配置方式](#configuration)(推荐):在 **webpack.config.js** 文件中指定 loader。
- [内联方式](#inline):在每个 `import` 语句中显式指定 loader。

<<<<<<< HEAD
### 配置方式 $#configuration$
=======
Note that loaders can be used from CLI under webpack v4, but the feature was deprecated in webpack v5.

### Configuration
>>>>>>> 22a468176de21a48af9015eb971ce0b7536a3154

[`module.rules`](/configuration/module/#modulerules) 允许你在 webpack 配置中指定多个 loader。
这种方式是展示 loader 的一种简明方式,并且有助于使代码变得简洁和易于维护。同时让你对各个 loader 有个全局概览:
Expand Down
14 changes: 13 additions & 1 deletion src/content/configuration/output.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,13 @@ MyLibrary = _entry_return_;

请注意,如果 `MyLibrary` 没有在你的库之前定义,那么它将会被设置在全局作用域。

<<<<<<< HEAD
##### type: 'assign-properties' <Badge text='5.16.0+' /> $#typeassignproperties$
=======
##### type: 'assign-properties'

<Badge text="5.16.0+" />
>>>>>>> 22a468176de21a48af9015eb971ce0b7536a3154

```js
module.exports = {
Expand Down Expand Up @@ -1151,7 +1157,7 @@ T> 在考虑 CommonJS 与 CommonJS2 之间的区别?虽然它们很相似,

##### type: 'commonjs-static' $#type-commonjsstatic$

<Badge text='5.66.0+' />
<Badge text="5.66.0+" />

```js
module.exports = {
Expand Down Expand Up @@ -1620,7 +1626,13 @@ MyLibrary = _entry_return_;

注意,如果 `MyLibrary` 在作用域中未在前面代码进行定义,则你的 library 将被设置在全局作用域内。

<<<<<<< HEAD
#### libraryTarget: 'assign-properties' <Badge text='5.16.0+' /> $#libraryTarget-assign-properties$
=======
#### libraryTarget: 'assign-properties'

<Badge text="5.16.0+" />
>>>>>>> 22a468176de21a48af9015eb971ce0b7536a3154

W> 最好使用 [output.library.type: 'assign-properties'`](#type-assign-properties)。

Expand Down
100 changes: 51 additions & 49 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2286,31 +2286,31 @@
"@svgr/babel-plugin-transform-react-native-svg" "^6.0.0"
"@svgr/babel-plugin-transform-svg-component" "^6.2.0"

"@svgr/core@^6.2.0":
version "6.2.0"
resolved "https://registry.yarnpkg.com/@svgr/core/-/core-6.2.0.tgz#187a7930695635382c1ab42f476a1d4d45a65994"
integrity sha512-n5PrYAPoTpWGykqa8U05/TVTHOrVR/TxrUJ5EWHP9Db6vR3qnqzwAVLiFT1+slA7zQoJTXafQb+akwThf9SxGw==
"@svgr/core@^6.2.1":
version "6.2.1"
resolved "https://registry.yarnpkg.com/@svgr/core/-/core-6.2.1.tgz#195de807a9f27f9e0e0d678e01084b05c54fdf61"
integrity sha512-NWufjGI2WUyrg46mKuySfviEJ6IxHUOm/8a3Ph38VCWSp+83HBraCQrpEM3F3dB6LBs5x8OElS8h3C0oOJaJAA==
dependencies:
"@svgr/plugin-jsx" "^6.2.0"
"@svgr/plugin-jsx" "^6.2.1"
camelcase "^6.2.0"
cosmiconfig "^7.0.1"

"@svgr/hast-util-to-babel-ast@^6.0.0":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-6.0.0.tgz#423329ad866b6c169009cc82b5e28ffee80c857c"
integrity sha512-S+TxtCdDyRGafH1VG1t/uPZ87aOYOHzWL8kqz4FoSZcIbzWA6rnOmjNViNiDzqmEpzp2PW5o5mZfvC9DiVZhTQ==
"@svgr/hast-util-to-babel-ast@^6.2.1":
version "6.2.1"
resolved "https://registry.yarnpkg.com/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-6.2.1.tgz#ae065567b74cbe745afae617053adf9a764bea25"
integrity sha512-pt7MMkQFDlWJVy9ULJ1h+hZBDGFfSCwlBNW1HkLnVi7jUhyEXUaGYWi1x6bM2IXuAR9l265khBT4Av4lPmaNLQ==
dependencies:
"@babel/types" "^7.15.6"
entities "^3.0.1"

"@svgr/plugin-jsx@^6.2.0":
version "6.2.0"
resolved "https://registry.yarnpkg.com/@svgr/plugin-jsx/-/plugin-jsx-6.2.0.tgz#5e41a75b12b34cb66509e63e535606161770ff42"
integrity sha512-QJDEe7K5Hkd4Eewu4pcjiOKTCtjB47Ol6lDLXVhf+jEewi+EKJAaAmM+bNixfW6LSNEg8RwOYQN3GZcprqKfHw==
"@svgr/plugin-jsx@^6.2.1":
version "6.2.1"
resolved "https://registry.yarnpkg.com/@svgr/plugin-jsx/-/plugin-jsx-6.2.1.tgz#5668f1d2aa18c2f1bb7a1fc9f682d3f9aed263bd"
integrity sha512-u+MpjTsLaKo6r3pHeeSVsh9hmGRag2L7VzApWIaS8imNguqoUwDq/u6U/NDmYs/KAsrmtBjOEaAAPbwNGXXp1g==
dependencies:
"@babel/core" "^7.15.5"
"@svgr/babel-preset" "^6.2.0"
"@svgr/hast-util-to-babel-ast" "^6.0.0"
"@svgr/hast-util-to-babel-ast" "^6.2.1"
svg-parser "^2.0.2"

"@svgr/plugin-svgo@^6.2.0":
Expand All @@ -2322,18 +2322,18 @@
deepmerge "^4.2.2"
svgo "^2.5.0"

"@svgr/webpack@^6.2.0":
version "6.2.0"
resolved "https://registry.yarnpkg.com/@svgr/webpack/-/webpack-6.2.0.tgz#00fafd32e1d59add7b554c40aa2e97e83f975686"
integrity sha512-KlLdGe93A8GDs19g8kjEmHwArgMAP6cUfegr2Nx+yDAYY32IPtjzm3SoqNP+I+cnOF1CToJu1clWTPEmdd8dXg==
"@svgr/webpack@^6.2.1":
version "6.2.1"
resolved "https://registry.yarnpkg.com/@svgr/webpack/-/webpack-6.2.1.tgz#ef5d51c1b6be4e7537fb9f76b3f2b2e22b63c58d"
integrity sha512-h09ngMNd13hnePwgXa+Y5CgOjzlCvfWLHg+MBnydEedAnuLRzUHUJmGS3o2OsrhxTOOqEsPOFt5v/f6C5Qulcw==
dependencies:
"@babel/core" "^7.15.5"
"@babel/plugin-transform-react-constant-elements" "^7.14.5"
"@babel/preset-env" "^7.15.6"
"@babel/preset-react" "^7.14.5"
"@babel/preset-typescript" "^7.15.0"
"@svgr/core" "^6.2.0"
"@svgr/plugin-jsx" "^6.2.0"
"@svgr/core" "^6.2.1"
"@svgr/plugin-jsx" "^6.2.1"
"@svgr/plugin-svgo" "^6.2.0"

"@textlint/ast-node-types@^4.4.3":
Expand Down Expand Up @@ -4301,10 +4301,10 @@ copy-to-clipboard@^3.3.1:
dependencies:
toggle-selection "^1.0.6"

copy-webpack-plugin@^10.2.1:
version "10.2.1"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-10.2.1.tgz#115a41f913070ac236a1b576066204cbf35341a1"
integrity sha512-nr81NhCAIpAWXGCK5thrKmfCQ6GDY0L5RN0U+BnIn/7Us55+UCex5ANNsNKmIVtDRnk0Ecf+/kzp9SUVrrBMLg==
copy-webpack-plugin@^10.2.4:
version "10.2.4"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-10.2.4.tgz#6c854be3fdaae22025da34b9112ccf81c63308fe"
integrity sha512-xFVltahqlsRcyyJqQbDY6EYTtyQZF9rf+JPjwHObLdPFMEISqkFkr7mFoVOC6BfYS/dNThyoQKvziugm+OnwBg==
dependencies:
fast-glob "^3.2.7"
glob-parent "^6.0.1"
Expand Down Expand Up @@ -5410,20 +5410,15 @@ eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==

eslint-visitor-keys@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2"
integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==

eslint-visitor-keys@^3.2.0:
eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1"
integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==

eslint@^8.7.0:
version "8.7.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.7.0.tgz#22e036842ee5b7cf87b03fe237731675b4d3633c"
integrity sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w==
eslint@^8.8.0:
version "8.8.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.8.0.tgz#9762b49abad0cb4952539ffdb0a046392e571a2d"
integrity sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ==
dependencies:
"@eslint/eslintrc" "^1.0.5"
"@humanwhocodes/config-array" "^0.9.2"
Expand Down Expand Up @@ -6741,16 +6736,16 @@ ignore@^4.0.6:
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==

ignore@^5.1.4, ignore@^5.1.8, ignore@~5.1.9:
version "5.1.9"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.9.tgz#9ec1a5cbe8e1446ec60d4420060d43aa6e7382fb"
integrity sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==

ignore@^5.2.0:
ignore@^5.1.4, ignore@^5.1.8, ignore@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a"
integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==

ignore@~5.1.9:
version "5.1.9"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.9.tgz#9ec1a5cbe8e1446ec60d4420060d43aa6e7382fb"
integrity sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==

image-q@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/image-q/-/image-q-1.1.1.tgz#fc84099664460b90ca862d9300b6bfbbbfbf8056"
Expand Down Expand Up @@ -10207,10 +10202,10 @@ postcss-scss@^0.3.0:
dependencies:
postcss "^5.2.4"

postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.5, postcss-selector-parser@^6.0.6, postcss-selector-parser@^6.0.8:
version "6.0.8"
resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.8.tgz#f023ed7a9ea736cd7ef70342996e8e78645a7914"
integrity sha512-D5PG53d209Z1Uhcc0qAZ5U3t5HagH3cxu+WLZ22jt3gLUpXM4eXXfiO14jiDWST3NNooX/E8wISfOhZ9eIjGTQ==
postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.5, postcss-selector-parser@^6.0.6, postcss-selector-parser@^6.0.9:
version "6.0.9"
resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.9.tgz#ee71c3b9ff63d9cd130838876c13a2ec1a992b2f"
integrity sha512-UO3SgnZOVTwu4kyLR22UQ1xZh086RyNZppb7lLAKBFK8a32ttG5i87Y/P3+2bRSjZNyJ1B7hfFNo273tKe9YxQ==
dependencies:
cssesc "^3.0.0"
util-deprecate "^1.0.2"
Expand Down Expand Up @@ -12168,6 +12163,7 @@ synckit@^0.4.1:
tslib "^2.3.1"
uuid "^8.3.2"

<<<<<<< HEAD
table@^3.8.3:
version "3.8.3"
resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f"
Expand All @@ -12184,6 +12180,12 @@ tailwindcss@^3.0.17:
version "3.0.17"
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.0.17.tgz#2c5fe6c364d76ec54644347c6f09befe0113b06f"
integrity sha512-OiHUsmOKQQEg/ocXaLIjk/kOz8EK2jF6iPuc1bQ4NsmhYl7sk70UDsGV02AJvBAAiJhinPCkDR8egT9qY+ulCw==
=======
tailwindcss@^3.0.18:
version "3.0.18"
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.0.18.tgz#ea4825e6496d77dc21877b6b61c7cc56cda3add5"
integrity sha512-ihPTpEyA5ANgZbwKlgrbfnzOp9R5vDHFWmqxB1PT8NwOGCOFVVMl+Ps1cQQ369acaqqf1BEF77roCwK0lvNmTw==
>>>>>>> 22a468176de21a48af9015eb971ce0b7536a3154
dependencies:
arg "^5.0.1"
chalk "^4.1.2"
Expand All @@ -12201,7 +12203,7 @@ tailwindcss@^3.0.17:
postcss-js "^4.0.0"
postcss-load-config "^3.1.0"
postcss-nested "5.0.6"
postcss-selector-parser "^6.0.8"
postcss-selector-parser "^6.0.9"
postcss-value-parser "^4.2.0"
quick-lru "^5.1.1"
resolve "^1.21.0"
Expand Down Expand Up @@ -13330,10 +13332,10 @@ webpack-sources@^3.2.3:
react-textarea-autosize "^5.2.1"
uuid "^3.1.0"

webpack@^5.67.0:
version "5.67.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.67.0.tgz#cb43ca2aad5f7cc81c4cd36b626e6b819805dbfd"
integrity sha512-LjFbfMh89xBDpUMgA1W9Ur6Rn/gnr2Cq1jjHFPo4v6a79/ypznSYbAyPgGhwsxBtMIaEmDD1oJoA7BEYw/Fbrw==
webpack@^5.68.0:
version "5.68.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.68.0.tgz#a653a58ed44280062e47257f260117e4be90d560"
integrity sha512-zUcqaUO0772UuuW2bzaES2Zjlm/y3kRBQDVFVCge+s2Y8mwuUTdperGaAv65/NtRL/1zanpSJOq/MD8u61vo6g==
dependencies:
"@types/eslint-scope" "^3.7.0"
"@types/estree" "^0.0.50"
Expand Down