4

In the Asp.Net MVC BundleConfig if i use ScriptBundle it shows below error for this code:

Code:

bundles.Add(new ScriptBundle("~/node/GobiJs").Include(
            "~/node_modules/...../test.js"
        ));

Error:

enter image description here

But if i use Bundle instead of ScriptBundle like

bundles.Add(new Bundle("~/node/GobiJs").Include(
                "~/node_modules/...../test.js"
            ));

it works fine. Can anybody tell me what's the wrong with ScriptBundle, why it is not working?

Arif
  • 6,094
  • 4
  • 49
  • 81
  • 3
    Difference between ScriptBundle and Bundle is ScriptBundle minifies, while Bundle does not. I have only encountered problems with this when there is problems with the code in the JS files, which jsminify cant figure out. So either stick with Bundle or check the js file for errors. – BattlFrog Jun 12 '19 at 17:03

0 Answers0