You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the paths object in require.config to declare aliases like Utils for Utils/Utils.js and the use these aliases in the define statements to specify your dependencies. When you run r.js, these aliases will be used as module names.
Insert the prefix (function(){ and suffix }()); after running r.js, which will only concatenate the modules. But it doesn't make sense, because the only global identifier, which will be used in the output bundle, will be define from require.js.
Hello,
My project workspace looks like this.
Modules/
|--> Src/
| |--> Application/
| | |--> Application.js
| |--> Home/
| | |--> Home.js
| |--> Utils/
| | |--> Utils.js
|--> Vendors/
| |--> Underscore/
| | |--> Underscore.js
| |--> jQuery/
| | |--> jQuery.js
| |--> Require/
| | |--> require.js
|--> r.js
I am trying to minify all above files and concatenate them to a single file (main.min.js), like shown below.
(function(){ define('underscore', [], (){ /* Content */ }); define('Home', [], (){ /* Content */ }); define('Utils', [], (){ /* Content */ }); define('Application', [], (){ /* Content */ }); }());
I tried with r.js to achieve this, but didn't work out for me.
Can someone please explain whether this can be achieved by r.js or not ?
Thanks
The text was updated successfully, but these errors were encountered: