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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:46:53+00:00 2026-06-18T10:46:53+00:00

Currently I’m building a JS library that can attach to and interacts with to

  • 0

Currently I’m building a JS library that can attach to and interacts with to any HTML5 Canvas element context.

However, the project is starting to get extensive with lots of files and thousands of lines of code. Each file represents a different object/module. Each file is currently laid out like this, and I’d really like to preserve some semblance of this style:

Object = function() { 
    // constructor
}

Object.prototype.method1 = function() {
    // Logic
}

Object.prototype.method2 = function() {}; // .... etc

And in the development version of the HTML I have a bajillion script tags (one for each file) that need to be in a precise order (for dependencies). I realize that this is very inefficient, and not very maintainable. But I’m not sure what is the best direction to go in to try and make my project easier to build and maintain. Port to NodeJS for the convenience of the tools and CommonJS module system? Convert to RequireJS? I’m just starting to read about Grunt, is that useful for my situation?

Improving my organization and introducing some sort of build system are both things I’ve put off doing for a while. And man do I regret it now.

  • 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-18T10:46:54+00:00Added an answer on June 18, 2026 at 10:46 am

    You need a module system.

    RequireJS, with the RequireJS optimizer, is the canonical solution here. You can use browserify if you’re more Node.js-leaning, or use the cjsTranslate feature of the RequireJS optimizer if you dislike the AMD cruft (define(function (require, exports, module) { ... });)—possibly in conjunction with Cajon in development.


    A build tool, like Grunt, is not the most important factor here. That is useful mainly when you have multiple build steps—e.g., run the RequireJS optimizer, and then compile your SASS to raw CSS, then concatenate the CSS, then turn your images into sprites, then… etc.

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

Sidebar

Related Questions

Currently, my ListViews look like this: How can I achieve that Windows 7 native
currently I am trying to make it so that I can get access to
Currently, I am writing a MiddleWare application that synchronizes information between and accounting application
Currently, I'm working on a project where I have a server - client relationship
Currently working with converting SQLException error messages into messages that are more useful for
Currently I am looking to develop an application for mobile devices that would be
Currently i have a list of sortable elements with a text: How can i
Currently I am re-vamping some code that I currently have written something like this:
Currently, I'm working with a company that has several different projects, all running on
Currently if i have dependency project opened, then maven use it instead of specified

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.