dimanche 12 novembre 2017

Globally accessible sass variables in Laravel Mix

My goal is to get the following code working in .vue files in Laravel project:

<style scoped lang="scss">
    @import 'variables'; // <-- file not found

    // ...
</style>

Currently, whenever I try to run the above code, the "file not found" error is thrown by the sass compiler.

My current webpack.mix.js:

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css')
   .webpackConfig({
       resolve: {
           alias: {
               tools: 'resources/assets/sass/tools' // <-- does not work
           }
       }
   });

So the question is, how do I configure laravel-mix, so that I am able to include global sass files without having to use relative paths?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2zQXFSn
via IFTTT

Aucun commentaire:

Enregistrer un commentaire