1

I'm using the BuildBundlerMinifier Nuget package in a .NET Core 2.1 application.

When trying to add bootstrap.js to the BundleConfig, sitebundle.min.js file gets deleted. If I remove bootstrap.js from BundleConfig, the bundle and minification process works as expected.

Bootstrap v5.0.2

Here is my bundleconfig.json

[
    {
        "outputFileName": "wwwroot/css/sitebundle.min.css",
        "inputFiles": [
            "wwwroot/lib/bootstrap/css/bootstrap.css",
            "wwwroot/css/site.css"
        ]
    },
    {
        "outputFileName": "wwwroot/js/sitebundle.min.js",
        "inputFiles": [
            "wwwroot/lib/jquery/dist/jquery.js",
            "wwwroot/lib/bootstrap/js/bootstrap.js",
            "wwwroot/js/site.js"
        ]
    }
]
KidBilly
  • 3,408
  • 1
  • 26
  • 40

1 Answers1

2

Same here,got the error when trying to minify the bootstrap.js v5.0.2. I also try other version(v4.6.0), but it works well.

Here is a workaround if disable the minify, it works fine with just bundling:

[
  {
    "outputFileName": "wwwroot/css/sitebundle.min.css",
    "inputFiles": [
      "wwwroot/lib/bootstrap/css/bootstrap.css",
      "wwwroot/css/site.css"
    ]
  },
  {
    "outputFileName": "wwwroot/js/sitebundle.min.js",
    "inputFiles": [
      "wwwroot/lib/jquery/dist/jquery.js",
      "wwwroot/lib/bootstrap/js/bootstrap.js",
      "wwwroot/js/site.js"
    ],
    "minify": {
      "enabled": false,      //change here....
      "renameLocals": true
    }
  }
]
Rena
  • 30,832
  • 6
  • 37
  • 72
  • Oh good. I was thinking it was probably a problem with the new Bootstrap. Thank you for verifying that. – KidBilly Aug 03 '21 at 14:17