babel/lib/6to5/transformation/transformers/optional-external-runtime.js
Aluísio Augusto Silva Gonçalves e985d8b25d Don't use interopRequire for dynamic imports
They don't need it at all and this also allows use of `externalRuntime`
without fear of the runtime ending up being loaded after it's used.
2015-01-18 17:31:55 -02:00

11 lines
331 B
JavaScript

exports.optional = true;
// In theory, it would be more appropriate to do this in `manipulateOptions`,
// but we need an identifier for the import and we can't get that before the
// AST is built.
exports.ast = {
enter: function (ast, file) {
file.opts.runtime = file.addImport(file.opts.runtime, "to5Runtime").name;
}
};