This repository has been archived by the owner on Jul 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 319
Add options generators for css/postcss/less/sass/ts #55
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No one comment... Is it intrsting feature or overhead? |
@timneutkens any thoughts? |
Merged
very nice! like it, and we should have this yes... also because it would fix the |
I agree it's a nice idea. As it is now (manually patched) I have this:
I find this helpful in debugging complex nested layouts. But the class names can get rather long e.g.
This PR would preserve the debug-ability in dev and save some bytes in prod. 🎉 |
This was referenced Feb 21, 2018
Hope the PR can be merged ASAP. |
This works today with const production = process.env.NODE_ENV === 'production'
module.exports = withCSS({
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: production ? '[hash:base64:4]' : '[name]_[local]-[hash:base64:4]', |
I'm going to close this in favor of vercel/next.js#8626 Thanks for your contribution 🙏 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make possible use
dev
andisServer
variables in css/postcss/less/sass/ts options.And I think, what using
cssModules
variable is not a good idea. Instead, we should pass it incssLoaderOptions
, since it was implemented here. Let's unify the way how to pass options. What are you thinking about that?it will look like that
Of course, there is backward compatibility.
Also, it fix passing cssLoaderOptions and it adds possibility:
rule
(for example, you can passexclude
andinclude
in rule)