Answer the question
In order to leave comments, you need to log in
Insert variable in gulpfile.js?
Tell me how to insert variables...
For example:
let gHOST= 'host.dev'; // переменная для хоста
function BROWSER_SYNC(none) {
gBROWSER.init({
proxy: '${gHOST}' // <-- тут вставить переменную
});
return none();
}
let gPREPROCESSOR= 'sass'; // переменная компилятора css стилей (less, sass)
function COMPILE_CSS() {
return src('assets/${gPREPROCESSOR}/main.{scss,less}') // <-- тут вставить переменную
.pipe(gSASS().on('error', gSASS.logError))
.pipe(dest('assets/css'));
}
return src([`themes/${theme}/assets/styles/${preprocessor}/theme.*`, `!themes/${theme}/assets/styles/${preprocessor}/_*.*`])
Answer the question
In order to leave comments, you need to log in
To insert a variable into text
1) Use quotes - `${Variable} text`
2) 'text' + Variable + 'text'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question