config.js 642 B

1234567891011121314151617181920
  1. // (1) The code `if (__DEV__) ...` can be removed by build tool.
  2. // (2) If intend to use `__DEV__`, this module should be imported. Use a global
  3. // variable `__DEV__` may cause that miss the declaration (see #6535), or the
  4. // declaration is behind of the using position (for example in `Model.extent`,
  5. // And tools like rollup can not analysis the dependency if not import).
  6. var dev; // In browser
  7. if (typeof window !== 'undefined') {
  8. dev = window.__DEV__;
  9. } // In node
  10. else if (typeof global !== 'undefined') {
  11. dev = global.__DEV__;
  12. }
  13. if (typeof dev === 'undefined') {
  14. dev = true;
  15. }
  16. var __DEV__ = dev;
  17. exports.__DEV__ = __DEV__;