Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change script or style files location from nuget?

I have a MVC project and I am using jquery, bootstrap and some other files from nuget. In mvc by default all of scripts files is in Scripts and all of css files is in Content as you know. I moved all scripts and css files to Content/css , Content/js , after that i got a problem because the files are going to the default location (js => Scripts, css=> Content) when i update my nuget packages.

So how can i solve this problem ? Is it possible ?

like image 306
Tolga Kısaoğulları Avatar asked Apr 17 '15 15:04

Tolga Kısaoğulları


1 Answers

In NuGet it is not possible to control where content files get installed to. The author of the NuGet package decides entirely what path to use for content files.

Instead of using NuGet for content files, I recommend using Bower, which is based on npm (the Node Package Manager).

With Bower you can control where files get installed to. Check out this SO post on the subject (especially the second answer): How to change bower's default components folder?


More info on Bower:

  • Getting started with Bower: http://blog.teamtreehouse.com/getting-started-bower
  • Bower support in Visual Studio: http://www.hanselman.com/blog/IntroducingGulpGruntBowerAndNpmSupportForVisualStudio.aspx
like image 110
Eilon Avatar answered Oct 21 '22 14:10

Eilon