Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables in LESS imports. #20

Open
berarma opened this issue Feb 9, 2016 · 4 comments
Open

Variables in LESS imports. #20

berarma opened this issue Feb 9, 2016 · 4 comments
Labels
Milestone

Comments

@berarma
Copy link
Contributor

berarma commented Feb 9, 2016

I've just noticed mini-asset won't find dependencies declared with an import that uses a variable in LESS.

I must say I don't really need this to work since the files I'm importing are vendor files that I won't change. Touching my files is enough to rebuild it. Just noticed it and thought I would report about it.

This will be hard to fully resolve. A possible workaround would be to have an option to disable incremental building or a configurable path to check for changes on any file inside it.

@markstory
Copy link
Owner

Could you give an example/sample of problematic files? Are you using node LESS, or the PHP implementations?

@markstory markstory added this to the 1.0.4 milestone Feb 9, 2016
@markstory markstory added the bug label Feb 9, 2016
@berarma
Copy link
Contributor Author

berarma commented Feb 9, 2016

This is a simple example:

@root-dir: vendor/twbs/bootstrap/less;
@import "@{root-dir}/bootstrap.less";

I'm using node LESS. Compilation works well, it's only that the incremental builds fail to see changes on files imported in this way. Since this imports have to be resolved at compile time I guess it would be hard to know the exact dependencies before compiling.

@markstory
Copy link
Owner

Ah ok. Resolving those variable imports will be nigh on impossible without a sophisticated CSS parser. While the code you have could be solved, other cases like

// variables.less
@rootdir: some/path

// app.less
@import 'variables.less';
@import "@{rootdir}/other.less";

Will not be handled as easily.

@berarma
Copy link
Contributor Author

berarma commented Mar 14, 2016

I came across this issue while trying to work around issue #21. I don't really need it. Given the complexity of a proper fix, and because it's only affecting the incremental builds, I think this could wait. One easy way to deal with filter dependencies that are hard to solve like this one would be using the workarounds I proposed in my first message or something alike.

@markstory markstory modified the milestones: 1.0.4, 1.0.5 Mar 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants