【问题标题】:bundleconfig.json configured, but bundles not being created in ASP.NET Core 3.1bundleconfig.json 已配置,但未在 ASP.NET Core 3.1 中创建捆绑包
【发布时间】:2020-07-08 22:03:33
【问题描述】:

使用Bundle and minify static assets in ASP.NET Core page 作为指导,我在我的项目根目录中创建了一个bundleconfig.json 并设置它来创建我想要创建的css 和脚本包。该页面似乎暗示虽然可以使用 Gulp 或 Grunt 等 3rd 方工具,但它们不是基本用途所必需的,我应该能够“构建应用程序”然后找到创建的捆绑 .min 文件,但它们不是在我建立之后。我尝试简化我的配置,将两个 CSS 文件捆绑在一起,但它仍然没有创建输出文件。这是我的 bundleconfig.json 内容:

[
    {
        "outputFileName": "wwwroot/css/tlgsso.min.css",
        "inputFiles": [
            "wwwroot/css/application.css",
            "wwwroot/css/site.css"
        ]
    }
]

我一直假设这意味着只需在根目录中添加一个名为“bundleconfig.json”的文件即可。与经常发生的情况一样,我只能找到有关 ASP.NET Core 1-2.0 的信息。我是否遗漏了触发捆绑和缩小所需的内容?

【问题讨论】:

    标签: asp.net-mvc-3 bundling-and-minification


    【解决方案1】:

    我需要安装BundlerMinifier.Core NuGet 包。然后就成功了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-15
      • 2020-06-18
      • 2013-09-24
      • 2013-02-17
      • 2021-01-03
      • 1970-01-01
      • 2021-03-13
      • 1970-01-01
      相关资源
      最近更新 更多