Как мне преобразовать следующий BundleConfig.cs в BundleConfig.json? Я переношу проект .NET 4.6.2 в NET ASP Core 2. Приведенные ниже ошибки и пытаюсь исследовать. Также пытался читать документы Microsoft https://docs.microsoft.com/en-us/aspnet/core/client-side/bundling-and-minification?view=aspnetcore-2.2&tabs=visual-studio
Original BundleConfig.cs
namespace Test.Web
{
/// <summary>
/// Bundle configs registration common class.
/// </summary>
public class BundleConfig
{
/// <summary>
/// Register Bundles.
/// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
/// </summary>
/// <param name="bundles"></param>
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/misc/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/misc/bootstrap.js",
"~/Scripts/misc/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
}
Попытка решения:
начинается в третьем абзаце
[
{
"outputFileName": "wwwroot/css/site.min.css",
// An array of relative input file paths. Globbing patterns supported
"inputFiles": [
"wwwroot/css/site.css"
]
},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
// Optionally specify minification options
"minify": {
"enabled": true,
"renameLocals": true
},
// Optionally generate .map file
"sourceMap": false
},
{
"outputFileName": "~/bundles/jquery",
"inputFiles": [
"\"~/Scripts/jquery/jquery-{version}.js"
],
// Optionally specify minification options
"minify": {
"enabled": true,
"renameLocals": true
},
// Optionally generate .map file
"sourceMap": false
},
Полученная ошибка:
Value must match regular expression \.css$
Value must match regular expression \.js$