Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create new compilerconfig.json Web compiler (Extension)?

I have project with a lot of less files, I'm used in Web compiler (developer Mads Kristensen) Extension for visual studio 2015.

my way to create compilerconfig.json is to compile single file and then edit manually the file, to work with all the other less files in the project. I'm sure it's wrong way...

I don't understand, how I can to create new compilerconfig.json file that include all the less files in existing project?

because in this situation when I added new less file the only way to add file is go to compilerconfig.json and add it manually.

we don't have option to create new compilerconfig.json with all the less files in automatically way?

Less Web Compiler

like image 508
Liran Patimer Avatar asked Oct 22 '15 11:10

Liran Patimer


People also ask

How to run compilerconfig json?

You can run the compiler on all compilerconfig. json files in the solution by using the keyboard shortcut Shift+Alt+Y or by using the button on the top level Build menu.

How do I compile less to CSS in Visual Studio?

css file nested under it in Solution Explorer after being enabled on the project. By default, compilation is off and that's indicated by a watermark at the bottom right corner of any LESS file. To enable LESS compilation, simply click the watermark and it changes to indicate LESS compilation is "on". All .

What is a Web compiler?

Web Compiler is a web-based program development environment. Compiler engine, editor, and file storage are on our cloud server so you are ready to start writing your codes, free from IDE installation and securing work space.


1 Answers

All you need to do after adding a new .less file to your project is right click the new .less file and "Compile File" should be the only option, by selecting that option it will then be added to the compilerconfig.json file. This will not add all the .less files in the project to the config, with a single click, but it will automatically add them with a quick click on each file, and you wont have to be adding them manually.

BEFORE:

[
  {
    "outputFile": "less/site.css",
    "inputFile": "less/site.less"
  }
]

AFTER:

[
  {
    "outputFile": "less/site.css",
    "inputFile": "less/site.less"
  },
  {
    "outputFile": "less/theme.css",
    "inputFile": "less/theme.less"
  }
]

You can also recompile all the files from the Task Runner Explorer window (View -> Other Windows -> Task Runner Explorer). There you should see the compilerconfig.json, below that you will see "LESS", you can "Run" that to compile all, or a select a single file. You can also compile on build.

An alternative method would be to use a gulp file. You can set up a task to get all the less files in your project, without another thought to it after setting it up.

like image 200
CodeBob Avatar answered Sep 23 '22 10:09

CodeBob