6

Is it possible to bundle all javascript (or css) files in a directory using Web Essentials? Similar to how System.Web.Optimizations bundling can take a directory?

I tried:

<directories>
   <directory>/myDirectory</directory>
</directories>

but this doesn't seem to work.

I need to bundle all files in a folder for an AngularJS app, and it's nice to not have to worry about adding each new file.

I want to use the Web Essentials bundling so that I can generate source maps.

JoshMB
  • 990
  • 1
  • 8
  • 14

2 Answers2

1

It's not possible to have WebEssentials "watch" a folder for changes and automatically include them, nor is it possible to use wildcards or directory paths.

https://webessentials.uservoice.com/forums/140520-general/suggestions/4201808-bundling-folders-instead-of-individual-files

It looks like the author has released a new extension for VS2015 that does have these features, but if you're on a version of VS prior to that then you're out of luck.

Hades
  • 1,975
  • 1
  • 23
  • 39
0

Here are a couple of links that explain exactly how to do this:

Mads Kristensen explains

Web Essentials site explanation

Edit: Here's a quick explanation - Once you've installed Web Essentials, right click on your folder that you want in your bundle, then select web essentials from the drop down, and finally click on create css bundle. This will create an xml file that describes your bundle and also create your bundle files.

JSnyder
  • 81
  • 1
  • 5
  • 2
    Hi and welcome to stackoverflow. Please give at least a short answer instead of only providing some links. [FAQ How To Answer](http://stackoverflow.com/help/how-to-answer) –  Sep 25 '14 at 15:16
  • 1
    This answer doesn't work .. it adds each file individually to the bundle and doesn't watch the folder for future additions. – Hades Feb 29 '16 at 15:12