-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(less): Add less compile target files as options. #1236
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
Conversation
Right now the LESSPlugin will compile all the .less files trying, althogh the less compiler is silently failing and sending just a stacktrace. This change allow you to send a 'compile-targets' array with the list of .less files that should be compiled. The issue is that some .less files are trying to use a not available variable at the scope of the file, the less files could contain a set of files with all the imports. If we tell the compiler to just compile these files we get the desired behaviour, your dist directory get the css files. There could be improvements over this change, like displaying a better less compiler message so that you know why your files did not compile. Another improvment is the fact that the less @import inside the node_modules are not resolved by the less compiler, perhaps we could add a special variable that is replaced on this files at compile time to resolve the path of the node_modules.
Right now the LESSPlugin will compile all the .less files trying, althogh the less compiler is silently failing and sending just a stacktrace. This change allow you to send a 'compile-targets' array with the list of .less files that should be compiled. The issue is that some .less files are trying to use a not available variable at the scope of the file, the less files could contain a set of files with all the imports. If we tell the compiler to just compile these files we get the desired behaviour, your dist directory get the css files. There could be improvements over this change, like displaying a better less compiler message so that you know why your files did not compile. Another improvment is the fact that the less @import inside the node_modules are not resolved by the less compiler, perhaps we could add a special variable that is replaced on this files at compile time to resolve the path of the node_modules.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it as part of Genuitec’s CLA |
This could be an example on how you'll specify the compile-targets
As a side note: |
After a second thought, maybe the change should be the other way around. Since Angular 2 is component based and you can have a css per component, perhaps the lessCompiler option should be to set the paths to exclude.
That will allow you to have all your less files under |
Send and exclude less regex file pattern to exclude the compilation of files. This change allow you to have all your less files under src/app.
This reverts commit 0831ce1
I signed it! |
CLAs look good, thanks! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Right now the LESSPlugin will compile all the .less files trying,
althogh the less compiler is silently failing and sending just a stacktrace.
This change allow you to send a 'compile-targets' array with the list of .less
files that should be compiled.
The issue is that some .less files are trying to use a not available variable
at the scope of the file, the less files could contain a set of files with all
the imports. If we tell the compiler to just compile these files we get the desired
behaviour, your dist directory get the css files.
There could be improvements over this change, like displaying a better less compiler
message so that you know why your files did not compile. Another improvment is the fact
that the less @import inside the node_modules are not resolved by the less compiler,
perhaps we could add a special variable that is replaced on this files at compile time
to resolve the path of the node_modules.