gruntjs/grunt-contrib-requirejs

Process pragmas before checking for multiple anonymous defines

leszekhanusz opened this issue · 1 comments

I am using pragmas to create a different module for two different output files.

During compilation the normalization is skipped because two anonymous defines are detected:

../../assets/js/models/appViewModel.js has more than one anonymous define. May be a built file from another build system like, Ender. Skipping normalization.

And the resulting javascript file will not work. Output of console:
Error: Mismatched anonymous define() module: function (a,b,c,d,e,f,g,h){return function(){ ....

But in my case, after the pragmas are processed there is only one anonymous define left in the file.

It works correctly if I do the normalization myself on the output file.

Is it possible to check for multiple anonymous defines only after the pragmas are processed ?

Alternatively, is it possible to add an option to always normalize in this case (something like 'normalizeMultipleAnonymousDefines = true' in the config)

You should pose this question on the require.js or r.js issue trackers. This plugin is just a thin wrapper for them.