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

Adds css.alwaysExtract config option #2002

Closed
wants to merge 2 commits into from
Closed

Adds css.alwaysExtract config option #2002

wants to merge 2 commits into from

Conversation

Karolis2011
Copy link

I found no logical option how to override those checks. So, I added option that allows to bypass assumptions that everyone uses HMR and doesn't want to extract CSS in to separate file while in development mode.

@LinusBorg
Copy link
Member

LinusBorg commented Jul 31, 2018

Provided we want to enable this, instead of introducting another config option I would argue to simply change the current behaviour to respect css.extract during development.

Users can then simply use NODE_ENV in their config file to decide when to set it to true, e.g.:

css.extract: process.env.NODE_ENV === 'production'

or turn the option into a string based one, something like:

css: {
  extract: true | false | 'production'
}

@Karolis2011
Copy link
Author

I am concerning that latter suggestion might break backwards compatibility. But it would break in edge cases, like when this value is explicitly set to true. But I like it.

@yyx990803 yyx990803 closed this in 686ec25 Jul 31, 2018
@yyx990803
Copy link
Member

Thanks for the PR - I'm not sure if the extra string-based value is necessary, since that is just the default behavior.

@Karolis2011
Copy link
Author

Karolis2011 commented Jul 31, 2018

If you will point at a way how to enable extract css on development builds, without deleting and readding module sets with webpack chaining, then I will be satisfied and be sure that this is unnecessary. Else I see this necessary.

@yyx990803
Copy link
Member

See my commit - I've made it so that setting it to true will enforce extraction even in development.

@Karolis2011
Copy link
Author

Karolis2011 commented Jul 31, 2018

Oh sorry, didn't see commit 686ec25
I was expecting it to be referenced in your comment. Anyway, thank you and sorry again.

@Karolis2011 Karolis2011 deleted the always-extract branch July 31, 2018 15:46
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.

3 participants