joetinger
joetinger

Reputation: 2729

Bundling individual files

I have a page in my MVC application with only one JavaScript file in it. Should I bundle this file or keep it as is?

My current code @section scripts{ <script src="~/Scripts/Custom/Home/Index.js" type="text/javascript"></script> }

Upvotes: 0

Views: 21

Answers (1)

dark_ruby
dark_ruby

Reputation: 7866

I would still suggest you put that file through bundling, advantages you get:

  1. It will get minified for production
  2. Should you add more javascript files later, it will be just a matter of adding those to a bundle, without ever making changes to your HTML template

Upvotes: 3

Related Questions