requirejs/almond

Is there a way to remove the missing dependency while building modules?

Closed this issue · 1 comments

Hi,
I want to build two version of script for both old browser and modern browser, so i put some code support IE into a file 'oldbrowser.js', and when i build all modules for modern browser with grunt, i use these config:

options:{
  exclude: 'oldbrowser.js'
}

Then combined the built file with almond, and i get error 'http/request missing oldbrowser'.
What i write in module http/request is something like below:

define(function(){
 if(isOldBrowser){
  require('oldbrowser');
 }
});

Thx for help.

I would use the stubModules config to just enter a stub entry for that module:

stubModules: ['oldbrowser']

That way the if(isOldBrowser) test is not needed.