Search code examples
javascriptvisual-studio-2012nugetstylesheetnuget-package-restore

Adding Javascript files from NuGet packages in Source Control


I have added jQuery and jQuery UI javascript and css files to my project through NuGet package manager. Also enabled the "Allow NuGet to download the missing packages" and "Automatically check for missing packages during build in Visual Studio" in Options dialog.

Is it a good practice to add the javascript and stylesheet files downloaded by the nuget packages into source control? If yes, then why?

Thanks in advance for your time and reply.


Solution

  • You do not need to add the packages directory at the solution level into source control. However you should add the files that jQuery and jQuery UI added to your project into source control. The files that were added and exist inside the project's directory or one of its subdirectories.

    NuGet will not restore the JavasScript and CSS files that were added into your project. NuGet will only restore files into the packages directory at the solution level.