Sha256: 6aba1ac5603fc87a4ebc9640c9bba891131431e1d269ab8859d67d254c47e4a6
Contents?: true
Size: 1.17 KB
Versions: 16
Compression:
Stored size: 1.17 KB
Contents
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = _default; var _utils = require("../../utils"); function isRegeneratorSource(source) { return source === "regenerator-runtime/runtime"; } function _default() { const visitor = { ImportDeclaration(path) { if (isRegeneratorSource((0, _utils.getImportSource)(path))) { this.regeneratorImportExcluded = true; path.remove(); } }, Program(path) { path.get("body").forEach(bodyPath => { if (isRegeneratorSource((0, _utils.getRequireSource)(bodyPath))) { this.regeneratorImportExcluded = true; bodyPath.remove(); } }); } }; return { name: "regenerator-entry", visitor, pre() { this.regeneratorImportExcluded = false; }, post() { if (this.opts.debug && this.regeneratorImportExcluded) { let filename = this.file.opts.filename; if (process.env.BABEL_ENV === "test") { filename = filename.replace(/\\/g, "/"); } console.log(`\n[${filename}] Based on your targets, regenerator-runtime import excluded.`); } } }; }
Version data entries
16 entries across 16 versions & 6 rubygems