index.js 574 B

123456789101112131415
  1. // Expose `IntlPolyfill` as global to add locale data into runtime later on.
  2. global.IntlPolyfill = require('./lib/core.js');
  3. // Require all locale data for `Intl`. This module will be
  4. // ignored when bundling for the browser with Browserify/Webpack.
  5. require('./locale-data/complete.js');
  6. // hack to export the polyfill as global Intl if needed
  7. if (!global.Intl) {
  8. global.Intl = global.IntlPolyfill;
  9. global.IntlPolyfill.__applyLocaleSensitivePrototypes();
  10. }
  11. // providing an idiomatic api for the nodejs version of this module
  12. module.exports = global.IntlPolyfill;