Questions tagged [grunt-contrib-requirejs]

Optimize RequireJS projects using r.js.

Grunt task to optimize RequireJS projects using r.js.

80 questions
2
votes
1 answer

GruntJS and custom task: require a RequireJS module

I am quite new with GruntJS and I wonder if it is possible to have a task that loads some RequireJs modules to process them and write the result within a JS file. I describe my scenario: I have a RequireJs based project with many files. I would…
2
votes
0 answers

Combining multiple files in grunt-requirejs

I have a Javascript application spanning multiple files using RequireJS, which I want to concatenate into one for the production environment. I've been looking at grunt-contrib-requirejs but the instructions for setting up the configuration in…
A. Duff
  • 4,097
  • 7
  • 38
  • 69
2
votes
1 answer

grunt failed due to jit-grunt: Plugin for the "help" not found

what is going on? i tried adding this below in Gruntfile.js, but it still doesn't work. module.exports =function(grunt){ require('time-grunt')(grunt); require('load-grunt-config')(grunt, { jitGrunt: true }); };
2
votes
1 answer

Running Google Closure compiler with grunt

I am trying to create a grunt task to build a javascript project using requirejs with closure compiler as the optimizer. I am using the grunt-contrib-requirejs plugin. https://www.npmjs.org/package/grunt-contrib-requirejs Although I haven't…
2
votes
2 answers

Grunt server: command not found in terminal

In my project directory, I installed Grunt by using the following command: npm install grunt ...after that I did Grunt server in my project directory but it gives me command not found error. Raj$ grunt server -bash: grunt: command not…
user3413185
2
votes
1 answer

Continuing development in CoffeeScript while implementing RequireJS

I want to implement RequireJS in a very large single page application that uses CoffeeScript and Grunt. We have separate files for different modules (services, Backbone, etc.). Implementing RequireJS is very straightforward - my main problem is with…
rwoody
  • 36
  • 4
2
votes
1 answer

Grunt requirejs concatenate and uglify the require modules to one file

Presently using grunt-contrib-requirejs plugin which has got optimize : 'uglify2' but no concat files to a single file option is found in that plugin. how to add or any example. I need all js files to be concatenated and uglified to a single file…
2
votes
1 answer

More than 1 requirejs task in grunt for different optimization options

I use r.js to cobble together all the js code in my SPA into 1 file. I use grunt's `grunt-contrib-requirejs' task for this, with the following: requirejs: { compile: { options: { name: 'app', out: 'build/js/app.js', baseUrl:…
tengen
  • 2,125
  • 3
  • 31
  • 57
1
vote
0 answers

I used requirejs oprimizer i.e uglify to minify momentjs but when i use moment it gives me the following error

TypeError: moment is not a function at Object.commonFunctionsFactory.formatDate However if i minify my momentjs online using jscompress the resulted file working fine for me. Grunt Task build_momentjs_file: { options: { baseUrl:…
1
vote
0 answers

Use non-optimized file with r.js

I am optimizing my Durandal build with the following optimizer settings: options: { name: '../lib/require/almond-custom', baseUrl: requireConfig.baseUrl, mainPath: 'app/main', paths: mixIn({ }, requireConfig.paths, { 'almond':…
1
vote
1 answer

Why my AngularJS + RequireJS application is not building via grunt-contrib-requirejs?

I have src of my application. I use AngularJS. I use RequireJS as module loader. I use Grunt as task runner. When I run application using src: everything is good. When I build application with Grunt, application is not working. I got no errors in…
1
vote
1 answer

yeoman generator-backbone and RequireJS - concat all modules into single file on build?

I'm trying to use Generator-Backbone generator for Yeoman with RequireJS. I don't need the lazy-loading of RequireJS, I just am using it for dependency management and organization. It's fine if it's used during development, but when I run…
tdc
  • 5,174
  • 12
  • 53
  • 102
1
vote
2 answers

How to load $templateCache before routes are created in app.config?

In my AngularJS app, I am trying to create a build using grunt and following plug-ins. grunt-contrib-clean grunt-contrib-requirejs grunt-angular-templates grunt-angular-copy I am able to successfully create the main.js file with all the…
1
vote
0 answers

Grunt error - cannot find module 'tough cookie'

I am getting an error and I don't know what to make of it. Grunt works just fine on my machine, but it is failing on my server. They're both the same OS. And I am thinking that my package.json might have installed a later version of something on my…
Jeremy
  • 1,717
  • 5
  • 30
  • 49
1
vote
2 answers

Trouble with require js shims and r.js

I'm having a few issues with r.js I'm hoping someone can shed some light on. Consider the following shim: shim: { plugin: ['jquery'], plugin2: ['jquery', 'plugin'] } And the following arbitrary plugins (note: they don't need to be jQuery…
Caspar
  • 410
  • 1
  • 3
  • 11