assemble-less
assemble-less copied to clipboard
How to use globalVars?
As documentation states the globalVars option prepend variables to the files. But i geting a parse error. The only file i use in assemble-less configuration is main.less that imports a variables.less where i use a template-directory-uri variable that i want to define in assemble-less config. This config is current like this:
less: {
development: {
files: {
'build/assets/main.css': 'less/main.less'
},
options: {
globalVars: {
'template-directory-uri': 'DEVELOPMENT URI'
}
}
},
production: {
files: {
'dist/assets/main.css': less/main.less'
},
options: {
globalVars: {
'template-directory-uri': 'PRODUCTION URI'
}
}
}
},
and in the variable.less that is included i have:
@icon-font-path: "@{template-directory-uri}/assets/";
By the way, it would be nice if the process option was applied to every imported less files instead of just the files listed in files item. What do u think about it?
Ok....weird behavior! If the DEVELOPMENT URI is set to something like http://localhost i just state
'template-directory-uri': " 'http://localhost' "
for some reason the "" was stripped of and cause a parse error beacuse the variable that is prepended is
@template-directory-uri: http://localhost
and not
@template-directory-uri: "http://localhost"
as it should be!! Weird though!