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

Production CSS is not minified/obfuscated #8984

Closed
Aditya94A opened this issue May 10, 2020 · 9 comments · May be fixed by #9223
Closed

Production CSS is not minified/obfuscated #8984

Aditya94A opened this issue May 10, 2020 · 9 comments · May be fixed by #9223

Comments

@Aditya94A
Copy link

While using global stylesheets with component classname props as usual, building for production leads to the same exact classnames still being used.

My best guess is that there would be significant css bundle size reduction if the
(production only) build process were to include any of the popular css minification tools.

https://github.com/css/csso
https://github.com/fmarcia/UglifyCSS
https://github.com/matthiasmullie/minify

Reproduction steps should be pretty straightforward, include a typical stylesheet into a component and use it, then build and inspect the result in devtools.

@iamarkadyt
Copy link

Was just about to open an exactly similar issue. If CRA is using the 'css-loader' this would be as simple as configuring the loader in the following way:

{ 
  test: /\.css$/,
  use: [
    // ... other loaders ...
    {
      loader: 'css-loader',
      options: {
        modules: true, // minify CSS class names, set to false when in dev mode
        localIdentName: '[sha1:hash:hex:4]' // length of compressed identifiers
      }
    }
    // ... other loaders ...
  ]
}

@stale
Copy link

stale bot commented Jun 11, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Jun 11, 2020
@Vrq
Copy link

Vrq commented Jun 11, 2020

Anyone looking into it?

@stale stale bot removed the stale label Jun 11, 2020
@iamarkadyt
Copy link

iamarkadyt commented Jun 16, 2020

I might look into it in a month or two, but not right now. Was hoping someone else would take care of this.

@Aditya94A
Copy link
Author

@gaearon @Timer @iansu Any thoughts?

@stale
Copy link

stale bot commented Jul 18, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Jul 18, 2020
@Aditya94A
Copy link
Author

Gotta be honest, I'm not a fan of this bot. Just because people lose hope and stop showing up after months have gone by, doesn't mean the issue no longer exists or isn't important. If anything this bot should be aimed at the owners of the repo, it's been so long, surely, we at least deserve some response.

@stale stale bot removed the stale label Jul 18, 2020
@stale
Copy link

stale bot commented Aug 22, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Aug 22, 2020
@stale
Copy link

stale bot commented Aug 29, 2020

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

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

Successfully merging a pull request may close this issue.

3 participants