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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:58:04+00:00 2026-06-09T11:58:04+00:00

I am looking into a way to write by BackboneJS application using a CommonJS

  • 0

I am looking into a way to write by BackboneJS application using a CommonJS structure which allows Javascript modules to be required. This application could then work on the client or server side with node.

I have looked into requirejs and other similar options but you have to write the app in a specific way which in my opinion looks really naff.

I have also looked at browserify and webmake which takes your code and any modules that are required and combines them into a single js file with the missing (require) methods. All a clever idea, but leaves the code on the client side a bit messy.

Is there such a thing out there which can take by code written in its commonJS format, compile all the required modules that are compatible with the browser and spit out a Javascript file (or several) that can be used in the browser without having to worry about missing require methods? Even better would be a solution tailored to backbone applications.

  • 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-09T11:58:05+00:00Added an answer on June 9, 2026 at 11:58 am

    You have a number of options for using CommonJS structured modules in the browser:

    1. RequireJS 2.0.2 supports the configuration option cjsTranslate. Setting this to cjsTranslate: true in your r.js optimizer configuration will wrap any included modules that appear to be in the CommonJS format with the define boilerplate. See details here.
    2. Cajon is new a module loader built on top of RequireJS that supports modules in the CommonJS format (also written by the RequireJS author @jrburke).
    3. The Volo dependency management tool (again by @jrburke) has the ability to include and translate cjs modules into amd modules. This is probably not a great option for you but worth including for completeness.
    4. You could write a server component that automatically wraps your code in the AMD define boilerplate. I believe this is the approach they’re taking at SoundCloud – see this blog post.

    Edit Aug 29, 2014: The current best practice here is arguably Browserify with generated source maps for easier client-side debugging.

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

Sidebar

Related Questions

I'm looking into creating a automated way to check the running version of our
Is there any way to speed up bulk inserting in 2005? I'm looking into
I am looking for a clean way to combine variables into a single string
I am looking for a way to dump input into my terminal from a
I'm looking for a way to load invalid (malformed) XML into an AS3 XML
I'm looking for the correct way to export my pictures sequence into a quicktime
I'm looking for a way to truncate a float into an int in a
I'm looking for a way to insert a new entry into a specific row
I'm looking for a way to load an XML file's contents directly into a
I'm looking for a way to pass a variable or string or anything into

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.