Open graymouser opened 12 years ago
After testing this out some more, this is the issue causing my Less to no longer compile correctly (the compiled Less was empty). The workaround that seems to be working for me is to put a comment before each import, just as @graymouser showed.
Ah, cool. Yes; at the moment adding a comment to the same line as the import statement will cause issues.
Just having multiple import with no comments causes issues as well. This appears to happen with or without extra line breaks between the imports.
Any chance this is going to get looked at anytime soon? Going back and filling all my Less files with extra comments is getting rather annoying.
It's on my list, but it's fairly low priority. Just make sure your comment isn't on the same line as the import statement and you'll be just fine.
Maybe this needs to be broken out into a separate issue, but the problem also occurs with imports that do not have comments. For example:
@import 'reset.less';
@import 'variables.less';
@import 'mixins.less';
@import 'layout.less';
@import 'type.less';
@import 'sprites.less';
This compiles without error, but the resulting CSS is missing half of the content of the imports. Adding a comment like this fixes it:
@import 'reset.less';
// Workaround
@import 'variables.less';
// Workaround
@import 'mixins.less';
// Workaround
@import 'layout.less';
// Workaround
@import 'type.less';
// Workaround
@import 'sprites.less';
I can confirm that this doesn't happen in the latest version of Less and Less.app.
Nope. I have plenty of tests that prove the import linking works just fine for the scenario you described. There are a few possibilities:
1) One of your imported Less files is blank. The Less compiler currently chokes on those.
2) Your file is not UTF-8 encoded. Any other text encoding is not supported.
3) Your file does not use normal line endings. This one is unlikely, but possible.
If any of those were the case, why does it suddenly work fine when comments are introduced before each line?
Please zip and send me a chain of Less files that demos this issue so I can test things on my end. Thanks!
Heya, I had a look through open bugs and couldn't find this one, though it may be similar to this closed bug https://github.com/bdkjones/CodeKit/issues/7
Basically I am modifying bootstrap.less to import a custom less file, when it is written like the following then CodeKit does not automatically pick up that ts-variables.less is imported by bootstrap.less
However if refactored the following way then it does
Although it is not really a problem for me now that I now about the refactor it was quite annoying to track down so thought I'd report it. Other than that just started using CodeKit and having much fun, keep up the great work :)