This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Add feature to compile a main LESS/SASS file regardless of which .less or .scss file is being edited. This would be useful when working on projects like Bootstrap with multiple .less files that compiles to a single .css file
If such files are included somehow to each other, then the compilation should work when you change any of them. Passing to Tomas, who works on this feature.
Could you please attach a sample project? Thanks.
Checkout the Bootstrap project at GitHub - https://github.com/twitter/bootstrap The main file is bootstrap.less which uses @import to include other files. The bootstrap.less while compile to single CSS file in the folder docs/assets/css
I just tried it and it works for me as expected - open tooltip.less, change it and save it. The bootstrap.css is recompiled. Please reopen and describe your scenario since I don't see any reason for this enhancement. Thanks. Product Version: NetBeans IDE Dev (Build 20130718-58d6a3ece26d) Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15 System: Linux version 3.8.0-26-generic running on amd64; UTF-8; cs_CZ (nb)
I had the same problem. I have edited the included files and the main css file was not compiled. The css file was only compiled when i have changed the main.less file. My problem was, that i have written "@import '_base';" instead of "@import '_base.less';". When i add the extension ".less" it works without problems.
@aex1701: As I wrote, it works for me. And as I wrote, reopen and attach a sample project and describe exact steps to reproduce. Otherwise there is nothing to be fixed here, sorry. Thanks.
Hi, I think that what xwisdom means is : when a less project is set to generate only one css file (as in Bootstrap), editing one of the included less file should not generate its css counterpart but just compile the main less file. So the Netbeans project settings should allow to target files and not just folders. Then Netbeans should detect included files (by parsing the main files and recursively included ones) or just scan the folder and sub folders where the main less file is located. Once one of this files is changed only the main less file should be compiled. For example : When using bootstrap (https://github.com/twbs/bootstrap/blob/master/less/) editing alerts.less should only trigger bootstrap.less compilation
Is there any news on this? The less compiler is completely unusable at the moment. It does recompile the main.less file which includes the @import statements. However, it also recompiles *every other* .less file in the less directory into it's own .css file. Just right now I tried the Netbeans less compiler on a project that has 50 .less files. And it automatically made 100 new css and .map files. Not usable at all.
Well, _how_ should be defined that only one CSS file should be generated? Any ideas? Thanks.
(In reply to Tomas Mysik from comment #9) > Well, _how_ should be defined that only one CSS file should be generated? > Any ideas? We need an answer to this question, feel free to reopen and tell us. Thanks.
It would be great if there were two seperate parameters. One defines the .less-file(s) that should be compiled (this could be a main.less or something) And a second parameter that defines which files should be watch (any saved changes on these files trigger the compiler, that only compiles the above defined .less-file) Thats how it works in most other IDEs or editors.
Yes, there should be a configuration to only compile a main LESS/SASS file especially since this is how Bootstrap which is popular functions. All LESS withing a folder should be watched and should only trigger the equivalent of this command, lessc less/style.less > css/style.css However, it is a minor bug because style.css will be compiled correctly and the other unused CSS files can simply be deleted before being pushed into production.
(In reply to Tomas Mysik from comment #10) > (In reply to Tomas Mysik from comment #9) > > Well, _how_ should be defined that only one CSS file should be generated? > > Any ideas? > > We need an answer to this question, feel free to reopen and tell us. > > Thanks. Suggestion 1: Additional field in preprocessor options to set a main file Suggestion 2: add a comment to every .less file "// main: main.less"
Created attachment 152218 [details] less testcase variables.less: @font-color: "#000000"; custom.less: body { color: @font-color; } main.less: @import "variables.less"; @import "custom.less"; Saving "custom.less" > NameError: variable @font-color is undefined Saving "main.less" > everything is fine
Found a workaround for this... Make your less directory look like this: less | -compile | --style.less | // @import "../src/bootstrap/bootstrap.less"; | -src | --bootstrap | ---bootstrap.less ---theme.less ---variables.less ---etc... Then set your "input" folder to be /less/compile in your project configuration settings and all of your "source" documents won't be automatically, however, changing the source files will result in a recompile. Tested on Windows 8 with Netbeans 8.0.2
I still have this issue in 8.2 I know there is a structural work around to get this working which is fine for a new project. The problem is when working with existing projects which i do mostly. The developers for the most part are not going to change the structure to add support for one or two IDE that could easily solve the problem themselves. The best solution in my opinion is an optional field on the settings in project properties. Field to be populated with file name and if left blank keep the existing compile all functionality. Might be prudent to make it a comma separated list to allow for multiple main files that need compiling.
With the workaround its fine, but doesnt minify the output files either. Could this be a nice feature to expand the module?