Questions tagged [requirejs]

RequireJS offers a cutting-edge solution for loading JavaScript files and modules. While it excels in browser scenarios, its versatility extends to various JavaScript environments such as Rhino and Node.js. It's important to note that if you're utilizing the built-in require call in Node.js, you aren't benefiting from RequireJS. For these cases, kindly refrain from using this particular tag and consider leveraging the require tag instead.

Load CKEditor.js with RequireJS following the textarea element

If you need a WYSIWYG editor, CKEditor could be the answer. Check out their documentation here. To properly load CKEditor, make sure to add the following script tag in the header: <script src="../ckeditor/ckeditor.js"></script> ... Then, inc ...

Encountering an error while including ngmin in the r.js build file

Currently, I am attempting to utilize ngmin with requirejs's r.js as outlined in a guide found here. Unfortunately, I have encountered issues and cannot seem to make it work. Despite installing both ngmin and requirejs globally and locally using npm, neith ...

Where is the ideal placement for NPM packages in a node.js application: at the beginning of the main.js file or within

Struggling to find a definitive answer to this particular inquiry. I am currently working with ParseServer on Back4App. My curiosity lies in the optimal location to require NPM packages, and the distinctions between these two approaches. Main.js - Samp ...

Leveraging the capabilities of Express functions on the client side through the require method in Node.js

Trying to access the configuration variables set in the file named test.js which contains -- var aws = require('aws-sdk'); exports.connect = function(){ return aws; } Now, I am attempting to access it upon an OnClick event taking place in the bro ...

Unforeseeable actions of Bootstrap-datepicker

I'm currently utilizing bootstrap-datepicker from the uxsolutions collection on GitHub and I've encountered some unusual behavior. At times, it loads properly while other times it does not: https://i.stack.imgur.com/mAVAc.png When it loads correctly, thi ...

Using webpack to load the css dependency of a requirejs module

Working with webpack and needing to incorporate libraries designed for requirejs has been smooth sailing so far. However, a bump in the road appeared when one of the libraries introduced a css dependency: define(["css!./stylesheet.css"], function(){ * mo ...

Utilize Require.js to Load Dropzone.js Library

I am interested in integrating Dropzone.js into an application that is built using Backbone and Require.JS. However, I am unsure of the correct implementation process. Should I utilize require()? What is the most effective way to handle this integration? ...

Verify if the program is operating on a server or locally

My current project involves a website with a game client and a server that communicate via sockets. The issue I'm facing is how to set the socket url depending on whether the code is running on the server or my local PC. During testing and debugging, ...

Numerous instances of Codemirror

I have the ability to generate and exhibit multiple dynamic codemirror instances, however, I am having trouble referencing them using the code snippet below. I suspect that the problem lies in creating a dynamic function name (not entirely sure how to ac ...

loading a module's dependencies seamlessly with RequireJS

Currently, I am working with Knockout and Require in my project. I have isolated some Knockout handlers into a separate module that I want to utilize. While there is no specific JavaScript code relying on this module, it is referenced in the data-bind attr ...

What is the process for importing a JSON file into a TypeScript script?

Currently, I am utilizing TypeScript in combination with RequireJS. In general, the AMD modules are being generated flawlessly. However, I have encountered a roadblock when it comes to loading JSON or any other type of text through RequireJS. define(["jso ...

Exploring the capabilities of require() in nodeJS

I'm wondering about the inner workings of the require() function in a nodeJS application. What exactly does require() return? Let's say I want to utilize two third-party packages: lodash and request. After installing these packages, my code mig ...

Troubles arise when trying to load AngularJS using RequireJS within the application

I am currently developing a NodeJS application that utilizes AngularJS for its front-end. Additionally, I am integrating RequireJS to handle the loading of JavaScript dependencies and then initialize the Angular app. Here is my approach: Inside my HTML fi ...

Illustrative demonstration of Vue with TypeScript

I am currently working on developing a HelloWorld application using Vue.js and TypeScript. index.html <script data-main="app.js" src="node_modules/requirejs/require.js"></script> <div id="app">{{text}}</div> app.ts import Vue f ...

Transform a universal feature into a module compatible with npm, browserify, and other platforms

I recently developed a straightforward library called https://github.com/FarhadG/script-tag-data. You have the option to either clone it down or install it using bower. However, I am interested in how I can convert it into an npm, browserify, etc. module ...

Does the RequireJS order plugin begin fetching files in the correct order, but fail to wait for them to finish downloading?

I've been trying to incorporate RequireJS into my project, but I'm encountering some issues with its functionality. It seems like the order plugin should download scripts in the correct order and wait for each one to finish before moving on to th ...

Using multiple main.js files with RequireJs in Play Framework 2.1.1 Java: A step-by-step guide

While working on a single-page app with AngularJs + RequireJs in Play Framework 2.1.1, I encountered an issue regarding the structure of my application. The project consists of two main sections - an admin dashboard and a normal website - both housed withi ...

Spring MVC applications might experience slow loading times when loading RequireJS libraries

Recently, I integrated RequireJS into my Spring MVC application to manage dependencies for various libraries, including jQuery and jQuery UI. Although I have successfully implemented it, I am facing an issue whenever the page is loaded or refreshed. Initia ...

Employing require.js, one can integrate a distinctive form of non-concatenated dat.gui source. This allows for the seamless

Excuse the SEO-friendly title, but I want to ensure that everyone can access the issue I'm currently working on. For those interested in customizing the appearance of dat.gui, you will need to download the source and include it using require.js following t ...

The CanJS model is unable to retrieve data from a .json file

Implementing MVC using AMD in canjs with requirejs has been my current focus. Here's a look at my domains.json file: [ "1":{"uid": "1","urls": "domain1.abc.com"}, "2":{"uid": "2","urls": "domain2.abc.com"}, "3":{"uid": "3","urls": "d ...

Steps for loading a directive into a module after instantiation with requirejs

Let me share a bit about my current challenge. Initially, I had all the necessary directive files injected into my main module in app.js using requirejs paths, and everything was functioning smoothly. It looked something like this: define(['angularAM ...

Error message: 'Vue is not defined' when using RequireJS

I'm facing an issue where the Vue object appears to be undefined in the browser after loading Vue with RequireJS. I'm puzzled by this situation and would appreciate any guidance that could help me narrow down the problem. It's worth mention ...

The Distinction Between "Q" and "q" in AngularJS and RequireJS

Currently, my project involves developing a single page application using AngularJS, Breeze, and RequireJS. While trying to configure AMD with requirejs to integrate Angular and Breeze, I ran into an issue related to Breeze's dependency on "q". Interesting ...

Learn the process of integrating VueJS with RequireJS

I am attempting to set up VueJS with RequireJS. Currently, I am using the following VueJS library: . Below is my configuration file for require: require.config({ baseUrl : "js", paths : { jquery : "libs/jquery-3.2.1.min", fullcalendar : "libs/ful ...

Unsuccessful attempt at testing RequireJS in a straightforward manner

As a beginner in RequireJS, I am currently experimenting to gain some experience. My goal is to make require load basic Angular first and then manually bring in Angular UI Bootstrap. However, I am encountering an issue where UI Bootstrap complains that ang ...

Component template using Knockout.js and RequireJS for HTML widgets

Trying to implement the widget example for knockout from here. Unfortunately, I am having issues loading the template from an external HTML file using requirejs. ko.components.register('like-or-dislike', { template: { require: &apos ...

Steps for deactivating AMD on four files and sequentially loading them using webpack

I am facing an issue where I need to disable AMD on 4 files and ensure that video.js is loaded before the other 3 files, as they are dependent on it. My attempt to achieve this in webpack.config.js was unsuccessful: const path = require('path') const webp ...

Utilizing npm packages in Laravel: a step-by-step guide

I am having trouble utilizing an npm package in my Laravel 5 application. I am not very familiar with node and require, so I would appreciate some help understanding how to properly use npm packages. The npm package I am attempting to use is: https://www ...

Dynamically transferring data from PHP to JavaScript in dynamically generated HTML elements

I have a collection of entities retrieved from a database, each entity containing its own unique GUID. I am showcasing them on a webpage (HTML) by cycling through the entities array and placing each one within a new dynamically generated div element. < ...

Having trouble passing $scope, $route, or $http in your AngularJS factory functions?

Why does my factory keep throwing an error when the $scope, $route, $http are present? app.factory("factoryContacts",function($scope,$route,$http){ return { getContacts: function(){ return $http({ me ...

Is incorporating RequireJS into an AngularJS project a valuable decision?

Is it true that AngularJS has its own module loading mechanism built-in and using RequireJS is unnecessary or even inefficient? I am working on an Angular project where the index.html file is becoming quite large. Would incorporating RequireJS help reduc ...

What could be causing the double execution of a Requirejs call in Node without any apparent reason

I'm currently trying to understand how to use requirejs in node. According to the RequireJS in Node manual, I should be able to run a synchronous call by using the following code snippet: //Retrieves the module value for 'a' synchronously var a = requirej ...

Having difficulty integrating requireJS and Node's Require in a single TypeScript project

I currently have a TypeScript project that is intended to work with both Node and the browser. In some scripts, I'm utilizing Node's require(), while in others requireJS's require(). The structure of my project directory is as follows: myPr ...

Optimize several projects or pages with RequireJS

How can I improve the efficiency of my multiple requirejs projects? For example, I have this structure below with two main.js in different locations/folders, build/ build.js dev/ index.php core/ js/ main.js libs/ ...

Troubleshooting issue: Angular not resolving controller dependency in nested route when used with requirejs

When the routes are multiple levels, such as http://www.example.com/profile/view, the RequireJS is failing to resolve dependencies properly. However, if the route is just http://www.example.com/view, the controller dependency is resolved correctly. Below ...

Exploring the Synergy Between Play 2.3.x, Webjars, and Requirejs: Unveiling

Queries: Is there a way to streamline the process of setting paths and shims in requirejs for webjars and their dependencies without manual intervention? (Especially for webjars that include a requirejs.config() call?) Does anyone have a straightforward e ...

Combining Mocha, BlanketJS, and RequireJS has resulted in the error message "No method 'reporter'."

While using Mocha with RequireJS, my tests are running smoothly. However, I encountered an issue when trying to incorporate blanket code coverage. The error Uncaught TypeError: Object #<HTMLDivElement> has no method 'reporter' keeps popping up. Belo ...

What sets npm install apart from manual installation?

I've been exploring requirejs recently. I'm trying to decide between installing it using npm install requirejs or manually downloading it from the website. Are there any differences between the two methods? Are there any advantages or disadvantages to co ...

standard_duration for Junior Selenium experiments

Is there an equivalent to Capybara's (RoR) default_wait_time for the Intern? setPageLoadTimeout and setFindTimeout don't seem to accomplish anything. this.timeout = 60000 seems to give an entire test 60 seconds, but I want all steps to have a default wai ...

Error encountered while loading a plugin in Typescript and RequireJS compilation process

Currently, I am working on a Typescript application in Visual Studio 2015 where RequireJS is used for loading modules. I have successfully loaded various modules from .ts classes and external libraries by using their typing .d.ts files. However, I have en ...

Utilizing AngularJS and RequireJS to incorporate a controller into the view

I am facing an issue while trying to add an Angular controller to my HTML view. Typically, in Angular, this can be done using: ng-controller="<controller>". However, due to my use of RequireJS, I have had to implement it differently. I need to includ ...

What is the process for compressing responses with Gzip using require.js in node.js?

I have a regular Express.js app where I am utilizing app.use(express.compress()) to compress gzip responses. When I navigate to regular view pages in Node.js, they all appear to be served using gzip in the browser. However, when I visit the page with th ...