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 8685595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:37:14+00:00 2026-06-12T22:37:14+00:00

This problem is so simple and common but I still haven’t been able to

  • 0

This problem is so simple and common but I still haven’t been able to find a good solution for it. So I thought maybe some experts here in Stackoverflow can guide me about the best practices.

Let’s say I have a several Javascript modules and put each of them in a separate file:

a.js
b.js
c.js
d.js

When releasing the software, I join them together and minify them:

//pseudo command:
cat a.js b.js c.js d.js | minify > all.js

Then I include reference to all.js in my html files like this:

<script src="all.js"></script>

So far so good. The problem is that when developing the software, I want to see the files as unminified and uncombined. One solution is to eliminate the minification from the process and do it like:

//pseudo command:
cat a.js b.js c.js d.js > all.js

and include it with the <script> tag. This works but I rather want to have the files included separately. So I have to do this in my html files:

<script src="a.js"></script>
<script src="b.js"></script>
<script src="c.js"></script>
<script src="d.js"></script>

This one works as I intended but then when releasing the code I have to go through all my html files and replace those 4 <script> tags with <script src="all.js"></script> and that is too much work for my project because there are many html files and we have debug/release cycles regularly.

One solution can be to have the script tag for all the files:

<script src="a.js"></script>
<script src="b.js"></script>
<script src="c.js"></script>
<script src="d.js"></script>
<script src="all.js"></script>

But this results to 4 erroneous requests at runtime. (because only all.js is available at release time).

How would you solve this problem?

  • 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-06-12T22:37:16+00:00Added an answer on June 12, 2026 at 10:37 pm

    Why don’t you use a javascript loader like headjs and serve your files dynamically?

    Then when you go into production, you just need to modify the headJs call and include only the minified js file.

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

Sidebar

Related Questions

This is a really simple problem, but I couldn't find a solution anywhere. I'm
This problem seems very simple to me, but I've been unable to fix it,
There must be a simple solution to this problem but for the love of
This is such a simple problem, but I can't find an answer anywhere... I
This problem is not readily reproducible in a simple example here but was wondering
hey guys having this really simple problem but cant seem to figure out have
I can't seem to find solutions to this supposedly simple problem /bug, so here
I've searched all over for a solution to this (including SO), however still haven't
This simple problem is kiling me. I posted something earlier about trying to clean
I am looking for a simple answer for this problem... I have a UITextView

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.