It is obvious that styles written in .vue
components should be extracted to separate files. Is there a built-in support or this? In pevious version I've edited config like this:
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
js: 'babel-loader' + Mix.babelConfig(),
css: plugins.ExtractTextPlugin.extract({
loader: 'css-loader',
fallbackLoader: 'vue-style-loader'
}),
//
but now this fails with error
I've added support for this on master. It'll be tagged at some point this week, likely.
Once tagged, you can turn on Vue style extraction with:
mix.options({ extractVueStyles: true });
@JeffreyWay thank you!
@JeffreyWay I'v added your commit to my config and I want to aware you: this makes impossible to use multiple stylesheets.
You can see that styles, extracted from two js files (app.js and ui.js) are extracted to both app.css and home.css. And they are similar at the end
Most helpful comment
I've added support for this on master. It'll be tagged at some point this week, likely.
Once tagged, you can turn on Vue style extraction with: