You can't. That package is for ASP.NET, not ASP.NET Core. However, you don't need it anyways. The only point to those statics was to tie in with the bundling framework in ASP.NET MVC so that the correct file would be referenced along with a cache-busting query string param.
Even then, they weren't strictly necessary as the bundle name was actually the file name that ended up being generated, so the only functional difference between @Scripts.Render("~/bundles/jquery")
and <script src="~/bundles/jquery"></script>
was that the former would affix the cache-busting param.
In ASP.NET Core, all of this has changed. Strictly speaking, ASP.NET Core is hands off when it comes to static resources. You are free to choose your own strategy there. Microsoft does provide LibMan to help you out, but it's most common to use npm
with webpack
or gulp
. In either of those cases, you set up your "bundles" via config. With LibMan, there's a libman.json. With npm
, you do it a bit more manually via either webpack.config.js
or gulpfile.js
, depending on whether you're using webpack
or gulp
, respectively.
The end result of any of these will be that you'll end up with bundled and minified css/js files in your wwwroot/lib
directory. Then, you just reference them with a normal script tag:
<script src="~/lib/jquery/jquery.min.js"></script>
To add the cache-busting query, you can utilize the asp-append-version
attribute of the ScriptTagHelper
:
<script src="~/lib/jquery/jquery.min.js" asp-append-version="true"></script>