如何在保存 asp.net 核心时更新捆绑的 js

how to update bundled js on save in asp.net core

在我的 asp.net 核心项目中,我有 bundleconfig.json:

"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
  "wwwroot/js/a.js",
  "wwwroot/js/b.js
],

我在 _Layout.cshtml 中引用了这样的包:

<script src="~/js/site.min.js"></script>

如果我编辑 a.jsb.js,在我构建项目之前,更改不会进入 site.min.js

是否可以在保存时更新包 (site.min.js)?

此功能是通过 VS 扩展启用的。看来您需要安装 VS 扩展并确保其配置正确。

根据 docs 它应该按原样工作。似乎可以通过右键单击 bundleconfig.json.

来对其进行许多不同的配置更改