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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:32:11+00:00 2026-06-17T22:32:11+00:00

I have a background in coding in languages that have a concept of classes.

  • 0

I have a background in coding in languages that have a concept of “classes”. Now that I am coding JavaScript, I would like to code in a similar way so that each object oriented “class” I create is its own separate file.

  • see Accessing "Public" methods from "Private" methods in javascript class

  • see http://phrogz.net/JS/classes/OOPinJS.html

In other languages, I would create import statements at the top of the class file to ensure other custom classes that were used within a class file so that the other custom classes were compiled into the final binary.

Of course JavaScript is not a compiled language; however, I would still like to be able to be include some kind of “import” statement at the top of custom class files so I could ensure the imported JS “class” file was available for the user’s browser to download.

It would be ideal if there were a 3rd party tool that combined all of my separate class files into one JS file so the browser only had to make one HTTP request for a single JS file instead of many calls for each indicidual JS “class”. Does anyone know if such a tool exists where it would do the following:

  1. allowed me to choose which JS files that I wanted to include in a single JS file
  2. crawled thru the files I selected in step 1 and found all the “import” statements at the top of each custom “class” file. These “import” statements could simply be specially formatted comments in the code that the 3rd party recognizes as import statements.
  3. The 3rd party would then create the single JS file with all of the files that were selected from step 1 and from all of the imported files that were found in step 2.

Some popular JavaScript frameworks seem to do just that. For example, jQueryUI allows you to customize the download of a single jQueryUI source file by allowing the user to check off which objects you want to use. If you uncheck an element that is needed for an item that you checked off, then the form tells you that there is a dependency you need to rectify before being able to proceed to download the file.

  • see http://jqueryui.com/download/

So is there a 3rd party tool that allows a developer to use some kind of “import” statement comment to ensure that many dependent JS files (and only the ones that the developer needs) to be combined into a single JS 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-17T22:32:14+00:00Added an answer on June 17, 2026 at 10:32 pm

    RequireJS was built for exactly this purpose.

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

Sidebar

Related Questions

I like a dark background when coding and have customised it to a scheme
I have some coding and already pushed this into a variable. I would like
I'm coming from a background in languages like Actionscript 3 where we have a
Background: I have a MainTest class that has many buttons, each of which instantiate
I have background image for a site header with fixed width. Now I am
I have this background image that is 175x175 but I am trying to make
I have a background image that is 1024 x 1024 pixels; the reason for
Coming to Haskell from a background in various OO languages, one thing that seems
I am trying to organize my JavaScript. What I would like to do is
Previously, I generate the programme using code, and I have a super class that

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.