viewer-config.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /* global requirejs */
  6. "use strict";
  7. /**
  8. * RequireJS configuration for JSON Viewer.
  9. *
  10. * ReactJS library is shared among DevTools. Both, the minified (production)
  11. * version and developer versions of the library are available.
  12. *
  13. * In order to use the developer version you need to specify the following
  14. * in your .mozconfig (see also bug 1181646):
  15. * ac_add_options --enable-debug-js-modules
  16. *
  17. * The path mapping uses paths fallback (a feature supported by RequireJS)
  18. * See also: http://requirejs.org/docs/api.html#pathsfallbacks
  19. *
  20. * React module ID is using exactly the same (relative) path as the rest
  21. * of the code base, so it's consistent and modules can be easily reused.
  22. */
  23. require.config({
  24. baseUrl: ".",
  25. paths: {
  26. "devtools/client/shared": "resource://devtools/client/shared",
  27. "devtools/shared": "resource://devtools/shared",
  28. "devtools/client/shared/vendor/react": [
  29. "resource://devtools/client/shared/vendor/react-dev",
  30. "resource://devtools/client/shared/vendor/react"
  31. ],
  32. }
  33. });
  34. // Load the main panel module
  35. requirejs(["json-viewer"]);