(332) 331-8677

Bundling and Minifying in ASP.NET Core

Create file bundleconfig.json in the application root

[
  {
    "outputFileName": "wwwroot/css/my.min.css",
    "inputFiles": [
      "wwwroot/css/my.css",
      "wwwroot/css/custom.css"
    ]
  },
  {
    "outputFileName": "wwwroot/js/my.min.js",
    "inputFiles": [
      "wwwroot/js/my.js"
    ],
    "minify": {
      "enabled": true,
      "renameLocals": true
    },
    "sourceMap": false
  }
]

NuGet package BuildBundlerMinifier