Questions tagged [grunt-contrib-requirejs]

Optimize RequireJS projects using r.js.

Grunt task to optimize RequireJS projects using r.js.

80 questions
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

How to properly build an AMD app as a single file with r.js using grunt?

I keep seeing this error when executing the compiled file: Uncaught Error: No json Here's my current requirejs grunt task configuration: requirejs: { options: { baseUrl: "build/repos/staging/dev", mainConfigFile:…
whallz
  • 2,365
  • 2
  • 22
  • 24
0
votes
0 answers

Grunt is not correctly building locally - missing files

Grunt has suddenly stopped building correctly locally. It's not building assets that are served by Angular, and the console is giving the following message: Uncaught Error: inc/../../../common/js/sv-common missing…
Alec Wilson
  • 566
  • 1
  • 7
  • 18
0
votes
1 answer

Using r.js to build entire project without needing overhead of require.js

I have a project with multiple javascript files, all formatted as AMD modules. I'm using r.js as part of my build process (using this grunt plugin to handle everything). After I build my project, I end up with a concatenated, minified file that has…
user3757174
  • 483
  • 2
  • 8
  • 17
0
votes
1 answer

Problems generating bundle with RequireJS

I have a Typescript project: myproject | +-src (folder) | | | +-main.ts | +-stringHandler.ts | +-disposable.ts +-out (folder) | | | +-... +-Gruntfile.js In my Grunt configuration I have a 2-step task which compiles all .ts files in…
Andry
  • 16,172
  • 27
  • 138
  • 246
0
votes
1 answer

Grunt-contrib-requirejs with shared libraries ERROR: no such file or directory (Update)

I have a project, that consists of multiple apps with the following structure: project |-node_modules |-common |-public |-js |-vendor |-almond.js |-require.js |-underscore.js …
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
0 answers

RequireJS: Module missing dependency after optimization

After a long development, I decided it was time to ship an optimized/bundled version of the JS in our project. So having used requirejs since the beginning, I thought it would be as simple as doing grunt build. Evidently, I was wrong and I spent a…
Patrick Browne
  • 5,290
  • 4
  • 16
  • 14
0
votes
1 answer

Error: Missing either an "out" or "dir" config value with r.js / grunt-requirejs

Below is my build configuration file: build.js { appDir: '../src', baseUrl: 'libs', paths: { app: 'js' }, dir: '../prod', out:"../js/main-built.js", fileExclusionRegExp: /.less$/, optimize: "uglify2", …
Ashwin Hegde
  • 1,733
  • 4
  • 19
  • 49
0
votes
1 answer

Alternative to require our app module each time to debug in console

When I want to debug my requirejs app, I need to reference my application everytime with something like: var App = require('app'); as stated here: http://requirejs.org/docs/api.html#modulenotes From that moment I can access everything via console…
mezod
  • 2,313
  • 3
  • 21
  • 31
0
votes
1 answer

Requirejs optimizer and locale setting that is set dynamically

I am using requirejs optimizer (r.js) through grunt and here is my requirejs config : requirejs.config baseUrl: '/scripts' locale: window.localStorage.getItem('locale') || null ... The thing is that the grunt r.js plugin…
httpete
  • 5,875
  • 4
  • 32
  • 41
0
votes
2 answers

Why does my grunt-contrib-requirejs does not optimize anything?

I am trying to get up and running with the grunt-contrib-requirejs task. Being new to RequireJS in general and having never used the optimizer/r.js, I am really confused how to get this to work. As a start, I have set up a simple directory…
Sven
  • 12,997
  • 27
  • 90
  • 148
0
votes
1 answer

How to have multiple output files in gruntfile.js when running requirejs

In Gruntfile.js for grunt-contrib-requirejs I can only register one task and I can only have one output file i.e. home_scripts.pack.js. However, I want to have as many as I want output files based on different 'include' criteria. For example,…
partizan
  • 469
  • 1
  • 9
  • 22
0
votes
1 answer

Loading issue on slow connection with single large minified file using grunt requirejs

I have a large amount of js files in my website which on minification and uglification using grunt-requirejs plugin gives a single file of size 1.6 MB. Loading this file on slow internet connection gives requiejs timeout error. Uncaught Error: Load…
0
votes
1 answer

What will happen if two plugins provide task with the same name in Grunt?

For example, both grunt-contrib-requirejs and grunt-requirejs provide a task called requirejs. What will happen if I installed two plugins? Which plugin will be used to run the task?
Hanfei Sun
  • 45,281
  • 39
  • 129
  • 237