Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. (function(global, factory) {
  2. if (typeof define === 'function' && define.amd) {
  3. define([], factory);
  4. } else if (typeof module !== 'undefined' && module.exports) {
  5. module.exports = factory();
  6. } else {
  7. global.UriTemplate = factory();
  8. }
  9. })(this, function() {
  10. ...
  11. // returns constructor function
  12. });
  13.  
  14. require.config({
  15. paths: {
  16. 'theLibrary: '../path/to/the/lib'
  17. }
  18. });
  19.  
  20. var the Lib = new SomeLib(...);
  21.  
  22. (function(){
  23. // the code
  24. })();
  25.  
  26. require.config({
  27. paths: {
  28. 'theLibrary: '../path/to/the/lib',
  29. 'anotherLib: '../path/to/anotherLib'
  30. },
  31. shim: {
  32. 'anotherLib: [
  33. 'theLibrary'
  34. ]
  35. }
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement