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

extract_css default value should be true for test environment too #2592

Closed
Fs00 opened this issue May 16, 2020 · 0 comments · Fixed by #2608
Closed

extract_css default value should be true for test environment too #2592

Fs00 opened this issue May 16, 2020 · 0 comments · Fixed by #2608

Comments

@Fs00
Copy link

Fs00 commented May 16, 2020

I want to propose a change to the default Webpacker configuration.
From what I've seen in my experience, the option extract_css should be true also for test environment, so that the latter is consistent with production one. This brings two advantages:

  • you are able to catch errors with
    stylesheet_pack_tag before going to production. We almost released a broken build of our website due to this difference between test and production environment, and it was passing all feature tests despite the problem!
  • if you are doing feature tests with Capybara, you won't get all the CSS and its source maps printed out to the console when an assertion on the content of the page fails

Therefore my proposal is to have extract_css defaulted to true, with the exception of development environment. I'll take care to create the PR if this proposal gets accepted.

PS: What's the rationale behind extract_css being defaulted to false in dev environment? I've read somewhere that is made "to better support CSS hot-reloading" but I couldn't understand if that's a pre-requisite for hot-reloading or just a nice-to-have.

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 a pull request may close this issue.

1 participant