This extension is deprecated as laravel-mix now allows to include custom scss-files as resources. See
mix.options({ globalVueStyles: '...' })
in laravel-mix@5 ormix.vue({ globalStyles: '...'})
in laravel-mix@6
This extension utilizes the sass-resources-loader and plugs it into laravel-mix.
Simply require('laravel-mix-sass-resources-loader')
in your webpack.mix.js
. Then you can apply your resources calling
mix.sassResources('resources/sass/bootstrap-variables.scss')
// or
mix.sassResources(['file1.scss', 'file2.scss'])
The resources are applied in the same order you call the sassResources
-function.
The plugin tries to find all entry points of scss-files and adds the sass-resources-loader to the corresponding webpack rules, which is the entry-points for the sass-sources added via mix.sass(...)
and the vue-loader. Therefore also scss/sass-files referenced from vue-components can access the resources.
Make sure your resource-files do not generate css code. It would be prefixed to all generated css.