-
-
Notifications
You must be signed in to change notification settings - Fork 201
Add a boolean parameter to Encore.disableCssExtraction() #756
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
Add a boolean parameter to Encore.disableCssExtraction() #756
Conversation
football2801
commented
May 7, 2020
Branch? | master |
---|---|
Bug fix? | no |
New feature? | yes |
Deprecations? | no |
Tickets | none |
License | MIT |
Allows for environment specific uses of disableCssExtraction that match conventions used in webpack.config.js by other methods such as enableSourceMaps or enableVersioning |
Hi @football2801, Thank you for this PR, I renamed it since it isn't actually related to environment variables. We thought a while ago about adding something like this but didn't because it could be a bit confusing for the users (see the responses to #564 (comment)). If you look at the other methods with that kind of parameter you'll see that they are all named Now for a |
After reading everything in that comment that you tagged, @Lyrkan, I agree with the comments you were making. I don't find it the least bit confusing. I actually made this PR due to people that I work with that requested that this method have this optional param. I know it would make my config file that much prettier. |
Ping @Kocal & @weaverryan |
I am in favor of this PR. I agree with @Lyrkan comment in #564. This PR makes total sense to me and keeps the config clean and consistent. (do you want to disable CSS extraction?) Even placed with enables, this does not confuse me at all: (do you want to enable source maps?) |
index.js
Outdated
* @returns {Encore} | ||
*/ | ||
disableCssExtraction() { | ||
webpackConfig.disableCssExtraction(); | ||
disableCssExtraction(enabled = true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean you enable the CSS extraction disabling? :D
I'm not a big fan of IMO, the best option is to:
|
@Kocal, enabling CSS extraction is the default behavior. The CSS extraction takes place without any |
Okay it makes sense, but I think we need to update the parameter
What do you think? |
Having an
I agree with that. |
I can make this change. I see this as a valid change that may improve code readability and is not a breaking change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This comment has been minimized.
This comment has been minimized.
0c89aa2
to
3935566
Compare
Thanks @football2801! After initially not being sure about this, I've since wanted it in a few projects :) |
I proposed a few extra docs in #867 :) |