Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 949803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:27:42+00:00 2026-05-15T23:27:42+00:00

As many of you know, most jQuery (or javascript, for that matter) plugins you

  • 0

As many of you know, most jQuery (or javascript, for that matter) plugins you find these days can be downloaded as either regularly formatted code, minified version, or both. For development purposes, I like to use the non-minified versions of the plugins, in case I need to set a Firebug breakpoint or look through it for any reason.

Now when I package my app and deploy it, I’d rather switch to the minified versions of the plugins, for efficiency’s sake. The only way I know to do this is to have both versions on hand, then manually change all the references in my Views (I use MVC) to point to the minified versions, then package and deploy. Ideally I’ll be minifying (and maybe obfuscating) my own javascript files as well.

Does anyone know of a better, more efficient way of developing with non-minified plugins (for readability) and deploying with minified versions (for efficiency)? Any articles you could point me to that talk about it? I’m pretty new to how to handle javascript deployment, and could probably brush up on best practices.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:27:42+00:00Added an answer on May 15, 2026 at 11:27 pm

    I tend to always use the minified versions of 3th party JSs unless I specifically need to look into it… In any case, you could write an html helper that inserts the correct script name based on some configuration (can be debug vs release)…

    You would end up with something like:

    <%= Html.IncludeJQuery() %>
    

    or if all your scripts follow the same convention ( .min.js for minified version) do a helper that inserts the ‘.min’ on the script that you pass is when in release

    <%= Html.IncludeCorrectVersionOfScript("jquery-1.4.2.js") %>
    

    Update:

    Html helpers, are extension methods to Mvc’s HtmlHelper class that you can use to emit the ActionLink, BeginForm, EditorFor, etc. You basically attach a new method (albiet static only) to that object so you can do Html.MyMethod…. A helper for this would be some like:

    public static class ScriptIncludeHelper
    {
        public static MvcHtmlString IncludeCorrectVersionOfScript(this HtmlHelper html, string script)
        {
            if (!html.ViewContext.HttpContext.IsDebuggingEnabled)
                script = script.Replace(".js", ".min.js");
            var tag = string.Format("<script type=\"text/javascript\" src=\"{0}\"></script>", script);
    
            return MvcHtmlString.Create(tag);
        }
    }
    

    Note that this is very simplified version (no validation of the string, etc.etc.etc.)

    Now you could use the IsDebuggingEnabled or a configuration in your web.config or a static configuration to define if you want to include the minimized version of the debug version…

    Hop this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.