Files
meteor/packages/modules/legacy.js
Ben Newman a69ba4904d Move meteorBabelHelpers to modules package, and restrict to legacy bundle. (#10596)
Should fix #10595.

Code from the application `node_modules` directory becomes part of the
`modules` package, so that it can be imported by any other package that
uses the module system, regardless of package load order.

Now that we compile code from `node_modules` using `babel-compiler` and
`meteor-babel` (#10585), `node_modules` code requires the same runtime
environment as any other Meteor JS code. For the most part, this need is
satisfied by the `@babel/runtime/helpers/...` modules, which are also
defined in the `modules` package because they come from `node_modules`.
However, in the legacy bundle, `meteorBabelHelpers.sanitizeForInObject` is
used to fix buggy for-in iteration in older Internet Explorers.

Thankfully, this extra helper code does not need to be included in the
modern or server bundles, but only in legacy code.
2019-06-25 13:08:38 -04:00

5 lines
260 B
JavaScript

// The meteor-babel/plugins/sanitize-for-in-objects plugin generates code
// that uses meteorBabelHelpers.sanitizeForInObject, but only when
// compiling code for the web.browser.legacy bundle. See #10595.
meteorBabelHelpers = require("meteor-babel-helpers");