I want to change the SCSS variable $fa_font_path based on the env APP_DIR ?
I have this website where on localhost/demo server It's on the subfolder and on the live server it's on the main folder, I added APP_DIR on .env to present the subfolder APP_DIR=/subfoulder/ where on the live server it's APP_DIR=/.
I found this answer and it's not working
const mix = require("laravel-mix");
var fa_font_path =
process.env.APP_DIR + "fonts/fontawesome-free/webfonts";
mix.js("resources/js/app.js", "public/js")
.sass("resources/sass/app.scss", "public/css", {
data: "$fa-font-path:'" + fa_font_path + "';"
})
.setResourceRoot(process.env.APP_DIR)
.sourceMaps();
this part generates an error
, {
data: "$fa-font-path:'" + fa_font_path + "';"
}
Error:
ERROR in ./resources/sass/app.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
ValidationError: Invalid options object. Sass Loader has been initialized using an options object that does not match the API schema.
Note: this is not a duplication question, I already googled and read other answers.