Skip to content

use parcel css #5959

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

Merged
merged 4 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"@mdx-js/loader": "^2.0.0-next.9",
"@octokit/auth-action": "^1.3.3",
"@octokit/rest": "^18.12.0",
"@parcel/css": "^1.4.0",
"@pmmmwh/react-refresh-webpack-plugin": "next",
"@svgr/webpack": "^6.2.1",
"autoprefixer": "^10.4.2",
Expand Down
7 changes: 6 additions & 1 deletion webpack.prod.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export default (env) =>
},
},
},
minimizer: ['...', new OptimizeCSSAssetsPlugin({})],
minimizer: [
'...',
new OptimizeCSSAssetsPlugin({
minify: OptimizeCSSAssetsPlugin.parcelCssMinify,
}),
],
},
plugins: [
new InjectManifest({
Expand Down
6 changes: 5 additions & 1 deletion webpack.ssg.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ export default (env) =>
libraryTarget: 'umd',
},
optimization: {
minimizer: [new OptimizeCSSAssetsPlugin({})],
minimizer: [
new OptimizeCSSAssetsPlugin({
minify: OptimizeCSSAssetsPlugin.parcelCssMinify,
}),
],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the OptimizeCSSAssetsPlugin docs

⚠️ For webpack v5 or above please use css-minimizer-webpack-plugin instead.

And the css-minimizer-webpack-plugin recently added @parcel/css support

module.exports = {
  optimization: {
    minimize: true,
    minimizer: [
      new CssMinimizerPlugin({
        minify: CssMinimizerPlugin.parcelCssMinify,
      }),
    ],
  },
};

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we were already using css-minimizer-webpack-plugin if you check the code, just old naming not removed. Doesn't mean we're still using OptimizeCSSAssetsPlugin. Let me update the naming to avoid confusion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

},
plugins: [
new SSGPlugin({
Expand Down
61 changes: 61 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2042,6 +2042,62 @@
dependencies:
"@octokit/openapi-types" "^11.1.0"

"@parcel/[email protected]":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@parcel/css-darwin-arm64/-/css-darwin-arm64-1.4.0.tgz#29101a341d11444378f503962ff25e3b7717565c"
integrity sha512-PDVrZihhhZpjkcqTBL2PxAA/NAH2QHF4L4HIH3cK0aw07crutAPG7KSEYXgXeU7g8bOH1g+/uABc+Xe6bjdZsQ==

"@parcel/[email protected]":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@parcel/css-darwin-x64/-/css-darwin-x64-1.4.0.tgz#910c726ee8e0bdbc06f717c3ffaf581c02bef959"
integrity sha512-AV7yyf8KBVVYaM6BKwMzq0ycSmdag95pnJCXsxmMOjVg+3nvkgalj/OHu3spqVzn/EVyICbqKZJCjZSxKgNuYg==

"@parcel/[email protected]":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@parcel/css-linux-arm-gnueabihf/-/css-linux-arm-gnueabihf-1.4.0.tgz#42dda3f5b18516e8362e6723cc068ed9f62f9009"
integrity sha512-Hv5+ustCxFahHu42+g7QPIdzgksSsbGnQCCzXTGY20j05pSo1BXuJFkhtPBFKMPnXmzM/3XNSvM8YjC0RHYZ7A==

"@parcel/[email protected]":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@parcel/css-linux-arm64-gnu/-/css-linux-arm64-gnu-1.4.0.tgz#c0bd629e188e83a3b5cde86579072884c1f72ceb"
integrity sha512-GQ4kX9YOjjQhM7NrUhi9PUSFjYwOa+MVJ+kFB6g6XxdYkxAkwBV/5VzxhJqswlQEVe5wotT28nKSYkgRsA9REA==

"@parcel/[email protected]":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@parcel/css-linux-arm64-musl/-/css-linux-arm64-musl-1.4.0.tgz#9a918a7f558a89caefdfece618e4112ba0482328"
integrity sha512-XxlGBJfOB1JKvIdE/fWBD7FemALvh/5oMNJW2Wjad5sl9SVBonLtE5mF4KdBZogfN/SX38ZFlANgrzKmf3x0cA==

"@parcel/[email protected]":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@parcel/css-linux-x64-gnu/-/css-linux-x64-gnu-1.4.0.tgz#b8e31f7a0f0eddbbb711070806dab27186e0b1b1"
integrity sha512-zdfwyGvo23nCKQSeKjpzMZotggyj95CEJOoBGuq0MhCJZrpYVgBOU7mn6tLnCvio42hHqFYzn1EsZLaXfoa4UA==

"@parcel/[email protected]":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@parcel/css-linux-x64-musl/-/css-linux-x64-musl-1.4.0.tgz#7af5c475d4808959203f40903bf7d38e626d6889"
integrity sha512-2ChvkPydF2g+x7Uzvx+/4qwS7uV+RwkV+7l7UwUf7mIv7bwV7soXH87S+TQtspqmUaiFNa/g2BFwA/+r/0Kj+Q==

"@parcel/[email protected]":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@parcel/css-win32-x64-msvc/-/css-win32-x64-msvc-1.4.0.tgz#eba714aa2c1a73641758e7b2ae4dafeccdfe3183"
integrity sha512-3MQMrwROT9o1B4hkMWTmQ/GlIzyxN9nM79S59G94+ZQTpSg3v3MgBwo9JXKgNISB1a2zDb+4Ve8TrcNb9yTOOg==

"@parcel/css@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@parcel/css/-/css-1.4.0.tgz#478a77c7bcdd34b88934165e30806720ae967c82"
integrity sha512-RdFCOjDg6AoevLd9yiXBlfNCLpszGE4s/r3CxlSlsRRljABkqN4cWpDbf0oyfb2BcTqw8z2aT5dN0ruISgtViQ==
dependencies:
detect-libc "^1.0.3"
optionalDependencies:
"@parcel/css-darwin-arm64" "1.4.0"
"@parcel/css-darwin-x64" "1.4.0"
"@parcel/css-linux-arm-gnueabihf" "1.4.0"
"@parcel/css-linux-arm64-gnu" "1.4.0"
"@parcel/css-linux-arm64-musl" "1.4.0"
"@parcel/css-linux-x64-gnu" "1.4.0"
"@parcel/css-linux-x64-musl" "1.4.0"
"@parcel/css-win32-x64-msvc" "1.4.0"

"@pmmmwh/react-refresh-webpack-plugin@next":
version "0.5.4"
resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.4.tgz#df0d0d855fc527db48aac93c218a0bf4ada41f99"
Expand Down Expand Up @@ -4587,6 +4643,11 @@ detab@^2.0.0:
dependencies:
repeat-string "^1.5.4"

detect-libc@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=

detect-newline@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651"
Expand Down