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.
dotnet new mvc
comes with 57 files, totalling 7.8MB in thewwwroot/lib
folder, but without a package management system to pull them in if they're not part of the repo. Feels weird to commit that many 3rd party files and add them to your own version control. – Cope