73

Nuget packages download Javascript files to ~/Scripts

I prefer to keep my content organized in a ~/content folder, which contains

~/content/css
~/content/images
~/content/scripts
~/content/scripts/vendor (for packages/ downlaoded scripts)
~/content/scripts/site (my own site's JS)

How do I make Nuget download Javascript files to ~/content/scripts/vendor?

reach4thelasers
  • 26,181
  • 22
  • 92
  • 123
  • possible duplicate of [Is it possible to change the location of packages for NuGet?](http://stackoverflow.com/questions/4092759/is-it-possible-to-change-the-location-of-packages-for-nuget) – Iman Mahmoudinasab Jan 07 '15 at 07:07

2 Answers2

57

At the moment, NuGet doesn't support installing packages resources elsewhere than the default location. There's an existing NuGet work item that would cover this feature : #1914 - Allow package resource folders to be configurable.

Alexandre Dion
  • 9,130
  • 2
  • 41
  • 29
  • 2
    Yeah, would be nice to have this feature, maybe something like this: http://i.imgur.com/4f308dT.png – Grief Coder May 23 '13 at 00:01
  • 10
    Don't understand why a work item with 200+ votes isn't resolved after more than 2 years. – Gigi2m02 Feb 20 '14 at 17:48
  • 2
    Because NuGet is an afterthought. It's only a light clone of gem/npm. I cant tell you the effort ASP.net / MVC developers will exert to rearrange the files of a lib to match the default project format, and never question anything about it. – QueueHammer Aug 25 '14 at 21:34
  • 3
    @Gigi2m02 over 3 years and counting now. – Nick Coad Apr 27 '15 at 01:49
  • 2
    @gnack Things has changed the last few years, so I don't expect it will ever change. See my added answer below. – Gigi2m02 Apr 27 '15 at 09:27
  • 1
    We are reaching 2017 and this hasn't been implemented yet... I love how it has been scheduled to `Soonish` release, but it's been more than 4 years already. – Matias Cicero Nov 09 '16 at 20:36
  • 1
    2017 and nothing. I guess we won't see this – zerohero Sep 13 '17 at 07:42
  • End of 2018, entering 2019 almost...7 years, still nothing – panzer Dec 05 '18 at 20:49
9

Not really an 'answer', but worth noting: With the shift of managing front-end libraries to Bower, I don't expect work item #1914 will ever be implemented. I'd highly recommend to look into how you can use the combination of NPM, Bower and Grunt to achieve your custom folder structure.

If you had an early look at VS2015, you'll notice that's the new recommended way for your project set-up and maintenance.

Bower

Dependency management tool used for managing front end components writting in html, css, jss (e.g. Bootstrap, Knockout, Angular, moment, lightboxes, gallery libraries, ...)

NPM

Dependency management tool used for managing node js modules

Grunt

Grunt is a javascript task runner tool. You can do a lot of things using grunt which you had to do manually otherwise: compiling files, linting files, moving files, ...

Difference between above three explained in detail here: Difference between Grunt, NPM and Bower ( package.json vs bower.json )

Community
  • 1
  • 1
Gigi2m02
  • 1,238
  • 3
  • 17
  • 33