Questions tagged [requirejs-optimizer]

The requirejs-optimizer is part of the r.js adapter for Node and Rhino, and it is designed to be run as part of a build or packaging step after you are done with development and are ready to deploy the code for your users.

The is part of the r.js adapter for and , and it is designed to be run as part of a build or packaging step after you are done with development and are ready to deploy the code for your users.

has an optimization tool that does the following

  • Combines related scripts together into build layers and minifies them via UglifyJS (the default) or Closure Compiler (an option when using Java).
  • Optimizes by inlining CSS files referenced by @import and removing comments.

Home Page: http://requirejs.org/docs/optimization.html

85 questions
0
votes
1 answer

RequireJS: loading modules relatively to the data-main file

I'm using RequireJS to load some modules. I'm serving static assets using a mirror CDN. The problem is that modules are loaded relatively to the website domain and not to the data-main file, so that modules are loaded this way: my-website.com/ ↳…
webpn
  • 101
  • 4
0
votes
1 answer

r.js leads to: Evaluating ./lib/jquery.js as module "jquery" failed with error: TypeError: Cannot read property 'createElement' of undefined

I am trying to use r.js on my code which uses jQuery. But it fails while evaluating jQuery. This is the error message I get: $ r.js init-edx-machine.js /usr/local/lib/node_modules/requirejs/bin/r.js:393 throw err; ^ Error:…
user5444681
0
votes
1 answer

How to use Ckeditor with requirejs and the r.js optimizer

I have a large project using CKEditor that is built using the requirejs optimizer (http://requirejs.org/docs/optimization.html) to combine all javascript into a single .js file. Individual modules like jquery and ckeditor and others are 'required'…
andysd
  • 126
  • 6
0
votes
1 answer

requirejs optimizer - how to change the optimized module name

I want to optimize some modules with the requirejs optimizer, but ran into a problem concerning paths. The main.js entry point requires the component on /build/modules/, but the name of the optimized module does not match this path. The component…
Johannes
  • 1,249
  • 3
  • 17
  • 33
0
votes
0 answers

"$.widget is not defined" after requirejs build

I'm using requirejs to load jquery.selectBoxIt. It uses the jQueryUI Widget factory, which is why I only loaded the widget factory from the jQueryUI official site into my project. When the project is loaded with config.js, selectBoxIt runs without…
Evgeniy
  • 3,219
  • 5
  • 25
  • 40
0
votes
0 answers

How to Load Json data inside Routeprovider?

Here i can not load the JSON data. what i am doing wrong in this below code. Can anyone please guide me? app.run(['$route', '$http', '$rootScope', function ($route, $http, $rootScope) { …
0
votes
1 answer

r.js evaluates 'text' plugin despite on 'stubModules' param

some code at first: My r.js boot file, which i run by r.js.cmd -o static/js/boot.js ({ baseUrl: './', preserveLicenseComments: false, name: 'boot', stubModules: ['text'], mainConfigFile: './requirejs/config.js', out:…
Andrei Zhamoida
  • 1,457
  • 1
  • 20
  • 30
0
votes
1 answer

requirejs multiple page application optimizer merges multiple js files, but still http requests not necessary files

I have created a multiple pages web applications, including: - a single requirejs configuration file, requestjsConfig.js - some libraries, like jquery.js, etc... - pages js, like homePage.js - the form event binding js, like pageHeader.js -…
richard
  • 1,845
  • 1
  • 20
  • 30
0
votes
1 answer

Requirejs optimizer with angularjs

I am trying to make a sample application using angularjs, ui-router and requirejs to lazyload my controllers. It works good locally but I want to write requirejs optimizer for production environment, Tried using grunt:requirejs tool for this but it…
0
votes
1 answer

RequireJS Optimizer: Exclude specific libs

My build process combines every application script and vendor lib into one single .min.js-file. Now, let's say one of this vendor libs is jQuery. My application will run in an environment where jQuery is already used. So I don't need to include…
dude
  • 5,678
  • 11
  • 54
  • 81
0
votes
1 answer

Replace module ids with fake names

Imagine an AMD Java-Script Application consisting of three modules with those IDs: common/core/api common/data/foo common/remote/bar When I'm building the optimized file with r.js, those ids are still inside compiled file. IMO this is unnecessary.…
McFarlane
  • 1,777
  • 2
  • 22
  • 39
0
votes
2 answers

Optimizing query, select from many tables

I have a SQL script which joins four tables. I am using many AND operations. Is there any solution how to optimize this script? SELECT s.ACCESS_CODE, a.ACCESS_CODE, MIN(b.ID), b.NAME, a.USER_ID, b.PARENT_ID,b.UPDATE_TIME FROM b_disk_simple_right s,…
MarciSM
  • 43
  • 7
0
votes
0 answers

RequireJS Optimizer - Only combine require lib and main.js

My build step for my RequireJS project is taking too long (about 14s) to combine all my modules and export to a single file. This means developing while watching my files has become extremely tedious. I'm using the node module to compile and I've…
Chris Dolphin
  • 1,578
  • 16
  • 28
0
votes
1 answer

Use requirejs in gruntjs to build a library, and use it in other projects

I am building a library which is a set of folders containing Model View Controller Javascript files. Each files has dependencies declared using require syntax: define([ 'modules/moduleA/src/moduleAModel', …
0
votes
2 answers

RequireJS optimize multi-page app using map config

I'm trying to modularize my existing project by breaking out functionality into separate applications that share a lot of common code. It's a Backbone/Marionette app, and everything is working fine in development mode, but I'm having trouble getting…
ken.dunnington
  • 905
  • 1
  • 7
  • 20