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

File globbing #49

Open
kamranayub opened this issue Jul 25, 2015 · 25 comments
Open

File globbing #49

kamranayub opened this issue Jul 25, 2015 · 25 comments

Comments

@kamranayub
Copy link

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
Copy link

👍

@ashrafsabrym
Copy link

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
Copy link

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
Copy link

riipah commented Aug 2, 2015

Yes, this is pretty much a must-have feature

@madskristensen
Copy link
Owner

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
Copy link

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
Copy link

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
Copy link
Owner

@DoctaWorm That's the plan

@304NotModified
Copy link

Would really like this (no need to bundle)

@forforeach
Copy link

Hi,
Any news on this topic?
Thanks

@resnyanskiy
Copy link

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
Copy link

mrcrowl commented Mar 21, 2016

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

@jessejjohnson
Copy link

Would love this feature.

@304NotModified
Copy link

Unfortunately,
PR #199 never get accepted. Don't know why.

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

@larsendaniel
Copy link

+1

@justindyer
Copy link

Starting to think this will never get implemented.

@PaulBullivant
Copy link

This would be really really useful.

@304NotModified
Copy link

There is a PR here, #317

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

@electricessence
Copy link

electricessence commented Jan 31, 2018

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
Copy link

Casimodo72 commented Mar 15, 2018

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 madskristensen/BundlerMinifier#342).

@electricessence
Copy link

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

@Marcelx8
Copy link

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
Copy link

stefanloerwald commented Jun 23, 2020

@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
Copy link

Marcelx8 commented Jun 23, 2020

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

@Oblomoff
Copy link

Without glob support this extension is useless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests