madskristensen / WebCompiler

Visual Studio extension for compiling LESS and Sass files
Other
451 stars 172 forks source link

File globbing #49

Open kamranayub opened 9 years ago

kamranayub commented 9 years ago

It feels like this should support file globs. I have about 12 LESS files in a pages directory that all need their own individual compiled files. Right now I think I need to manually add a JSON entry for each one. I'd rather do something like:

  {
    "files": "Content/pages/*.less",
    "minify": {
      "enabled": false
    },
    "includeInProject": true,
    "sourceMap": false,
    "options": {}
  },
emrekilinc commented 9 years ago

:+1:

ashrafsabrym commented 9 years ago

Please give this higher priority. In Web Essentials 2013, every time I save a .less file, it's auto-compiled. Now in Web Compiler I have to add an entry for every single file. My project has a very large number of LESS files, and they needn't have specific compilation configuration for every single file.

As @kamranayub mentioned, it will be better if we could just specify configurations for *.less.

justindyer commented 9 years ago

I forked the project and added support for *.less syntax. You can take a look at it below. It feels a little primative, but it works. I am not sure if it is pull request quality.

https://github.com/justindyer/WebCompiler

riipah commented 9 years ago

Yes, this is pretty much a must-have feature

madskristensen commented 8 years ago

The challenge here is to make source maps work when the output is combined to a single file. I'm not sure how I should do that. I can easily combine multiple files into one and then run the compiler. The problem with that is that if the compilation fails, I can't show the correct error in the Error List since it now all points to the combined file instead of the individual source file that contains the error.

Mikey1982 commented 8 years ago

You could run the compiler for each file and then combine the output...

For my case i need an output file for each less file with x.less to x.css convention. Is that possible?

DoctaWorm commented 8 years ago

To add to this.

Could wildcard support be added to compiling javascript files from ES6 to ES5?

Right now I have a rule in my text editor for es6 to be a javascript file so the compilerconfig.json starts to look like this:

  {
    "outputFile": "App/modules/repeaty/repeaty.js",
    "inputFile": "App/modules/repeaty/repeaty.es6"
  }
  {
    "outputFile": "App/modules/document-viewer/document-viewer.js",
    "inputFile": "App/modules/document-viewer/document-viewer.es6"
  }

Now the larger this project gets the larger this json file is going to get and it's gonna look cluttered.

Is it possible to have a simple solution of:

  {
    "outputFile": "App/*.js",
    "inputFile": "App/*.es6"
  }

or something very similar to this?

madskristensen commented 8 years ago

@DoctaWorm That's the plan

304NotModified commented 8 years ago

Would really like this (no need to bundle)

forforeach commented 8 years ago

Hi, Any news on this topic? Thanks

resnyanskiy commented 8 years ago

It could be a very useful feature. I agree that there is some ambiguous situations because we shouldn't bundle files, but as for me the bundling doesn't need here. Looks like the most convenient way is to add 'inputDirectory/outputDirectoy' settings, as it done in #142. If we re-use 'inputFile/outputFile' it would create inconsistent/unexpected behavior or will copy BundleMinifer functions to WebCompiler and we go back to old almighty WebEssentials. @feherzsolt, FYI.

mrcrowl commented 8 years ago

Please see pull request #199 for one possible implementation of this.

jessejjohnson commented 7 years ago

Would love this feature.

304NotModified commented 7 years ago

Unfortunately, PR https://github.com/madskristensen/WebCompiler/pull/199 never get accepted. Don't know why.

So it seems sending a PR isn't an option :/

larsendaniel commented 7 years ago

+1

justindyer commented 7 years ago

Starting to think this will never get implemented.

PaulBullivant commented 6 years ago

This would be really really useful.

304NotModified commented 6 years ago

There is a PR here, https://github.com/madskristensen/WebCompiler/pull/317

but dunno what the next step there. Not sure if the checklist is mandatory

electricessence commented 6 years ago

Any news here?

Apparently globbing is shunned because or scss load/compile order. I had to create a single file with a list of imports to get this to work the way i wanted.

Casimodo72 commented 6 years ago

Adding each file manually and adjusting the options for it is really tedious. Adding globbing would also solve the issue with BundlerMinifier adding both the CSS and its minified CSS to the bundle for me (see https://github.com/madskristensen/BundlerMinifier/issues/342).

electricessence commented 6 years ago

My solution to this was to have a single .scss file that contains imports. :/

Marcelx8 commented 4 years ago

Has this been resolved? I'm in need of the glob and I don't find a solution anywhere. I try to define the stylesheets from a JSON object, and would like to not have to set each file within a specified folder for each theme needed.

stefanloerwald commented 4 years ago

@Marcelx8 this fork / new implementation implements a -r option for compiling all resources in a folder (that's not 100% the same as globbing, but usually gets the job done). Caveat is that it so far only supports scss compilation and minification and js minification.

Hope that helps Stefan

Marcelx8 commented 4 years ago

@stefanloerwald Thanks for the quick reply. I will update you when I got it to work!

Oblomoff commented 2 years ago

Without glob support this extension is useless.