Sha256: 147e95b30aef4d52bc75c9463afbaddd9484f613ad095747ce77ba7ed5ba0da5

Contents?: true

Size: 1.03 KB

Versions: 10

Compression:

Stored size: 1.03 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) {
        console.log(`\n[${this.file.opts.filename}] Based on your targets, regenerator-runtime import excluded.`);
      }
    }

  };
}

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
condenser-0.0.8 lib/condenser/processors/node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js
jester-data-8.0.0 node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js
ezii-os-5.2.1 node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js
ezii-os-2.0.1 node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js
ezii-os-1.1.0 node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js
ezii-os-1.0.0 node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js
condenser-0.0.7 lib/condenser/processors/node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js
ezii-os-0.0.0.1.0 node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js
ezii-os-0.0.0.0.1 node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js
condenser-0.0.5 lib/condenser/processors/node_modules/@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js