I've just created an ASP .Net Web Application using the dotnet new webapp
command.
I wonder if I the wwwroot/lib
folder should be committed?
It looks like it contains versioned libraries and the version is not mentioned anywhere else in the application, so I think I should commit them.
But I really don't want to have distributions of 3rd party libraries in my git repository.
With recent changes in ASP.Net core web application. you can choose to ignore adding client side lib (content of wwwroot folder) in your version control such as git.
they need to be restored during build.
you can use LibMan to restore those libraries during build.
this article from microsoft will guide you how to enable restoring client side library during build so that you don't have to add them to your version control.
since it also contains the specific version so that there will not be any compatibility issues.
example libman.json file
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "[email protected]",
"files": [
"jquery.min.js",
"jquery.js",
"jquery.min.map"
],
"destination": "wwwroot/lib/jquery/"
},
{
"provider": "unpkg",
"library": "[email protected]",
"destination": "wwwroot/lib/bootstrap/"
},
{
"provider": "filesystem",
"library": "C:\\temp\\lodash\\",
"files": [
"lodash.js",
"lodash.min.js"
],
"destination": "wwwroot/lib/lodash/"
}
]
}
Hope this helpful.