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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:46:21+00:00 2026-06-17T08:46:21+00:00

I am new to RequireJS and maybe this is an already discussed issue but

  • 0

I am new to RequireJS and maybe this is an already discussed issue but I could not find a clear answer or opinion about this.

I have an application working with RequireJS. It has a lot of JavaScript files loaded by Require as they are needed. Working as expected.

Looking to Fiddler inspector I could see that all the files were loaded when the application started. I believe that Require has made a deep traversal of all the references to JavaScript files and loaded them all in the beginning.

If this is the way it works I believe that it would be better to generate a single file, minify it, and load it using a <script> html tag.

If I generate one single file with all scripts, and pre-load them with <script> will RequireJS load them again?

Am I doing something wrong?

In a production environment what could be the better solution?

Thanks in advance.

  • 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-17T08:46:22+00:00Added an answer on June 17, 2026 at 8:46 am

    What you want is the RequireJS Optimizer.

    The optimizer does the following (from the docs):

    • Combines related scripts together into build layers and minifies them via UglifyJS (the default) or Closure Compiler (an option when using Java).
    • Optimizes CSS by inlining CSS files referenced by @import and removing comments.

    Here’s one article on the topic for further reference.

    Have a look also at r.js, the command line tool which includes the optimizer. Using r.js, you can generate an optimized build from an application file main.js with just:

    node r.js -o build.js
    

    where build.js is a requirejs config file containing your build profile (baseUrl, paths, etc.).

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

Sidebar

Related Questions

I have read lots of questions and answers about this issue on StackOverflow, but
I would like to load and use mustache by requirejs. Maybe this question has
I am new to backbone js and require js. I use requirejS to organize
I have this code require 'mechanize' @agent = Mechanize.new page = @agent.get('http://something.com/?page=1') next_page =
Disclaimer: I'm fairly new to AJAX! I've looked around, and I'm not sure which
I know I already asked related question but now it's a bit different situation.
I am having this kind of mysterious issue here. I am currently using Entity
I'm searched and found other questions on this but none have solved my issues.
I know this type of question has been asked a lot, but I really
Apologies if the title is vague, but it's not the easiest question to describe.

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.