修改 bundleconfig.json 对 js 进行 bundle&minify
// js
{
"outputFileName": "wwwroot/js/all.min.js",
"inputFiles": [
"node_modules/jquery-slim/dist/jquery.slim.js",
"node_modules/popper.js/dist/js/popper.js",
"node_modules/bootstrap/dist/js/bootstrap.js",
"wwwroot/js/site.js"
],
"minify": {
"enabled": true,
"renameLocals": true
},
"sourceMap": false
},
{
"outputFileName": "wwwroot/js/vendor.js",
"inputFiles": [
"node_modules/jquery-slim/dist/jquery.slim.js",
"node_modules/popper.js/dist/js/popper.js",
"node_modules/bootstrap/dist/js/bootstrap.js"
],
"minify": {
"enabled": false
}
}
设置 MVC 和中间件
- 注册 MVC 服务到 IoC 容器
- 在 ASP.NET Core 管道里使用并配置 MVC 中间件
注册 MVC 服务仅需在 Startup 的 ConfigureService