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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:16:05+00:00 2026-06-08T22:16:05+00:00

I develop an iPad/iPhone App web app. Both share some of the resources. Now

  • 0

I develop an iPad/iPhone App web app. Both share some of the resources. Now I wanna build a bootstrap js that looks like this:

requirejs(['app'], function(app) {
 app.start();
});

The app resource should be ipadApp.js or iphoneApp.js. So I create the following build file for the optimizer:

{
  "appDir": "../develop",
  "baseUrl": "./javascripts",
  "dir": "../public",
  "modules": [
    {
      "name": "bootstrap",
      "out": "bootstrap-ipad.js",
      "override": {
        "paths": {
          "app": "ipadApp"
        }
      }
    },
    {
      "name": "bootstrap",
      "out": "bootstrap-iphone.js",
      "override": {
        "paths": {
          "app": "iphoneApp"
        }
      }
    }
  ]
}

But this doesn’t seems to work. It works with just one module but not with the same module with different outputs.

The only other solution that came in my mind was 4 build files which seems a bit odd. So is there a solution where i only need one build file?

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

    AFAIK the r.js optimizer can only output a module with a given name once – in your case you are attempting to generate the module named bootstrap twice. The author of require.js, @jrburke made the following comment on a related issue here:

    …right now you would need to generate a separate build command for each script being targeted, since the name property would always be “almond.js” for each one.

    He also suggests:

    …if you wanted just one build file to run, you could create a node program and drive the optimizer multiple times in one script file. This example shows using requirejs as a module and calling requirejs.optimize().

    I took a similar approach in one of my projects – I made my build.js file an ERB template and created a Thor task that ran through my modules and ran r.js once for each one. But @jrburke’s solution using node.js is cleaner.

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

Sidebar

Related Questions

I'm working on a Javascript-intensive web app designed to run on iPhone/iPad for now.
I have a iPhone app and want to develop iPad app with the same
Now am working for iPhone/iPad applications. Am interesting to develop apps for Mac OS
I want to develop a native universal app(i.e for iPhone and iPad) for my
I am develop a stock view app on iPad. I figure out that qtstalker
I want to develop an App that requires wired communication between Web cam type
I am trying to develop turn by turn navigation app for iphone and ipad.
I have to develop an iPad TV guide that looks like What's On TV
I want to develop a talking app for the iPhone and iPad. My question
develop android apps that should support iphone,ipad,android.is there any way for developing this kind

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.