This PR adds a configuration flag to extract the compiled CSS into a separate file.
Motivation
For production builds there are advantages to extract the CSS into a separate file:
CSS requested in parallel
CSS cached separate
Fewer style tags (older IE has a limit)
Faster runtime (less code and DOM operations)
Changes
By adding a configuration flag the user has total control over using CSS extraction or not. The flag is false by default to not introduce a breaking change. Because v3 of this plugin is not yet final and Laravel Mix V5 is still used a lot this PR is based on v2 of the plugin.
Usage
Set mix.reactCSSModules(null, true) to enable CSS extraction. Then load the compiled CSS in your Blade file using Mix:
<link rel="stylesheet" href="{{mix('js/app.css')}}">
This PR adds a configuration flag to extract the compiled CSS into a separate file.
Motivation For production builds there are advantages to extract the CSS into a separate file:
Changes By adding a configuration flag the user has total control over using CSS extraction or not. The flag is
false
by default to not introduce a breaking change. Because v3 of this plugin is not yet final and Laravel Mix V5 is still used a lot this PR is based on v2 of the plugin.Usage Set
mix.reactCSSModules(null, true)
to enable CSS extraction. Then load the compiled CSS in your Blade file using Mix:<link rel="stylesheet" href="{{mix('js/app.css')}}">