Closed Dailoge closed 4 years ago
This is supported. Information on how is covered in point 6 of the FAQ.
I don't understand; i have many main file, for example: pages/index/index.less pages/detail/index.less page/personal/index.less and more...
how should i write?
First, to clarify, "main" file just means a file that @imports
other less files.
If you always want to compile all of the above files every time any .less file is saved, then edit the JSON file for your user settings, and add:
{
"less.compile": {
"main": ["pages/index/index.less", "pages/detail/index.less", "pages/personal/index.less"]
}
}
If you only want to update certain main files when specific imported less files change, then you can add a comment to the top of the imported file:
e.g. imagine a file at: pages/index/anchors.less
. It could contain the following main
directive:
// main: ../../index.less
a { text-decoration: none }
... Easy LESS doesn't automatically figure out which main files should be compiled. i.e. it doesn't detect @import
statements in other files. You have to tell it where the other files are that import the "child" file.
ok, I know, thanks You're really great, man
i have another issue, how should i write 'out' and 'main' comment to the top of the imported file; i try
// out: true
// main: index.wxss
html {
body {
margin: 0px;
}
}
but it not work, i need your help, thanks
All directives must be on a single line at the top of the file, comma separated:
// main: index.wxss, out: true
html {
body {
margin: 0px;
}
}
In this way, it still doesn't work
I want to set many main file, but i don't kown how solve it