要解决ASP.NET Core 3.1中出现“ASP.NET Core 3.1已经配置了bundleconfig.json,但没有创建捆绑包”的问题,您可以按照以下步骤进行操作:
BundlerMinifier.Core
nuget 包。您可以在项目的 .csproj
文件中找到对应的包引用:
请注意,将 x.x.x
替换为您所使用的 BundlerMinifier.Core
版本号。
在项目的根目录下创建名为 bundleconfig.json
的文件。确保该文件与您的 .csproj
文件位于同一目录下。
打开 bundleconfig.json
文件,并确保它包含正确的捆绑配置。以下是一个示例的 bundleconfig.json
文件:
[
{
"outputFileName": "wwwroot/css/site.min.css",
"inputFiles": [
"wwwroot/css/site.css"
],
"minify": {
"enabled": true,
"renameLocals": true
}
},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
"minify": {
"enabled": true,
"renameLocals": true
}
}
]
请根据您的项目需要进行相应的修改。
BundlerMinifier.Core
根据您的配置生成捆绑包。这样,您就可以解决“ASP.NET Core 3.1已经配置了bundleconfig.json,但没有创建捆绑包”的问题,并生成所需的捆绑包。