Answer the question
In order to leave comments, you need to log in
How to specify folder for images from sass in Laravel mix?
Tell me this moment.
So that images and fonts, when compiling SASS, fall into the folder I need, I specify the directives
mix.config.fileLoaderDirs.images = '/myFolder1/images';
mix.config.fileLoaderDirs.fonts ='/myFolder1/fonts';
mix.config.fileLoaderDirs.images = '/myFolder1/images';
mix.config.fileLoaderDirs.fonts ='/myFolder1/fonts';
mix.sass('resources/app1.scss', '/myFolder1/app.css');
// Переназначаю папки хранения images и fonts
mix.config.fileLoaderDirs.images = '/myFolder2/images';
mix.config.fileLoaderDirs.fonts ='/myFolder2/fonts';
mix.sass('resources/app2.scss', '/myFolder2/app.css');
Answer the question
In order to leave comments, you need to log in
Why, in fact, push two projects into one config? Write different ones, and run them separately.
I don't remember now if it is possible to specify different .mix.js files in package.json. But you can definitely write conditional constructions inside this file. It's just a js file. So be guided by the environment variables that you set in the command line ..
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.copyDirectory('resources/assets/img', 'public/img');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question