Laravel-mix: Extract Vue Styles for several entry points.

Created on 18 Nov 2018  路  3Comments  路  Source: JeffreyWay/laravel-mix

Hello!

I have the following problem. I need to extract all the styles in a separate file from the vue components. When I have several entry points, the styles are overwritten, and it turns out that in the vue-styles.css file only the styles from all components of the last entry point.

.js('resources/assets/js/cart.js', 'js')
.js('resources/assets/js/profile.js', 'js')

From the example above, the styles for the last file only will be extracted. I think it does not add to the file, but overwrites the file.

Most helpful comment

@greal this will do what you want:

mix.options({ 
  extractVueStyles: '[name].css'
})

All 3 comments

Having the same issue.

@greal this will do what you want:

mix.options({ 
  extractVueStyles: '[name].css'
})

@lazabogdan Thank you! Very helpful!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amin101 picture amin101  路  3Comments

jpmurray picture jpmurray  路  3Comments

Micaso picture Micaso  路  3Comments

dtheb picture dtheb  路  3Comments

pixieaka picture pixieaka  路  3Comments