dojox.profile.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. var profile = (function(){
  2. var testResourceRe = /\/tests\//,
  3. copyOnly = function(filename, mid){
  4. var list = {
  5. "dojox/dojox.profile":1,
  6. "dojox/package.json":1,
  7. "dojox/mobile/themes/common/compile":1
  8. };
  9. return (mid in list) || /^dojox\/resources\//.test(mid) || /(png|jpg|jpeg|gif|tiff)$/.test(filename);
  10. },
  11. excludes = [
  12. "secure",
  13. "cometd",
  14. "data/(demos|ItemExplorer|StoreExplorer|restListener)",
  15. "drawing",
  16. "editor/plugins/(ResizeTableColumn|SpellCheck)",
  17. "embed/(IE)",
  18. "flash",
  19. "gantt",
  20. "help",
  21. "image/(Gallery|SlideShow|ThumbnailPicker)",
  22. "jq",
  23. "jsonPath",
  24. "lang/(aspect|async|docs|observable|oo|typed|functional/(binrec|curry|linrec|listcomp|multirec|numrec|tailrec|util|zip))",
  25. "layout/(BorderContainer|dnd|ext-dijit)",
  26. "mobile/app/",
  27. "rails",
  28. "robot",
  29. "storage",
  30. "sql",
  31. "widget/(AnalogGauge|AutoRotator|BarGauge|Calendar|CalendarFx|CalendarViews|DataPresentation|DocTester|DynamicTooltip|FeedPortlet|FilePicker|FisheyeList|gauge|Iterator|Loader|Pager|Portlet|RollingList|Rotator|rotator|SortList|UpgradeBar)",
  32. "wire",
  33. "xmpp"
  34. ],
  35. excludesRe = new RegExp(("^dojox/(" + excludes.join("|") + ")").replace(/\//, "\\/")),
  36. usesDojoProvideEtAl = function(mid){
  37. return excludesRe.test(mid);
  38. };
  39. return {
  40. resourceTags:{
  41. test: function(filename, mid){
  42. return testResourceRe.test(mid);
  43. },
  44. copyOnly: function(filename, mid){
  45. return copyOnly(filename, mid);
  46. },
  47. amd: function(filename, mid){
  48. return !testResourceRe.test(mid) && !copyOnly(filename, mid) && !usesDojoProvideEtAl(mid) && /\.js$/.test(filename);
  49. },
  50. miniExclude: function(filename, mid){
  51. return /\/demos\//.test(mid);
  52. }
  53. },
  54. trees:[
  55. [".", ".", /(\/\.)|(~$)/]
  56. ]
  57. };
  58. })();