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

fix(css-config): css minify not work when using style-loader #1331

Merged
merged 2 commits into from
Jul 7, 2022

Conversation

chenjiahan
Copy link
Member

PR Details

Description

We use css-minimizer-webpack-plugin to minify CSS, but it can not work with style-loader, see: webpack-contrib/css-minimizer-webpack-plugin#80

If we enabled style-loader, we should add cssnano to minify the CSS code.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have updated changeset
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@changeset-bot
Copy link

changeset-bot bot commented Jul 6, 2022

🦋 Changeset detected

Latest commit: 5edaff5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@modern-js/css-config Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Jul 6, 2022

Codecov Report

Merging #1331 (5edaff5) into main (d86f009) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1331   +/-   ##
=======================================
  Coverage   63.70%   63.70%           
=======================================
  Files         876      876           
  Lines       38357    38359    +2     
  Branches     7304     7306    +2     
=======================================
+ Hits        24435    24437    +2     
  Misses      13887    13887           
  Partials       35       35           
Impacted Files Coverage Δ
packages/cli/css-config/src/postcss.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d86f009...5edaff5. Read the comment docs.

@chenjiahan chenjiahan merged commit 4a7f2a2 into web-infra-dev:main Jul 7, 2022
@chenjiahan chenjiahan deleted the css_minify_0706 branch July 7, 2022 01:52
@caohuilin caohuilin mentioned this pull request Jul 7, 2022
targeral pushed a commit that referenced this pull request Jul 15, 2022
* fix(css-config): css minify not work when using style-loader

* fix: null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants