How to use the babel-plugin-external-helpers/package.json.version function in babel-plugin-external-helpers

To help you get started, we’ve selected a few babel-plugin-external-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github artsy / emission / transformer / upstream.js View on Github external
const babel = require("babel-core");
const crypto = require("crypto");
const externalHelpersPlugin = require("babel-plugin-external-helpers");
const fs = require("fs");
const generate = require("babel-generator").default;
const inlineRequiresPlugin = require("babel-preset-fbjs/plugins/inline-requires");
const json5 = require("json5");
const makeHMRConfig = require("babel-preset-react-native/configs/hmr");
const path = require("path");
const resolvePlugins = require("babel-preset-react-native/lib/resolvePlugins");

const { compactMapping } = require("metro-bundler/src/Bundler/source-map");

const cacheKeyParts = [
  fs.readFileSync(__filename),
  require("babel-plugin-external-helpers/package.json").version,
  require("babel-preset-fbjs/package.json").version,
  require("babel-preset-react-native/package.json").version,
];

/**
 * Return a memoized function that checks for the existence of a
 * project level .babelrc file, and if it doesn't exist, reads the
 * default RN babelrc file and uses that.
 */
const getBabelRC = (function () {
  let babelRC = null;

  return function _getBabelRC(projectRoot) {
    if (babelRC !== null) {
      return babelRC;
    }
github facebook / metro / packages / metro / src / transformer.js View on Github external
const json5 = require('json5');
const path = require('path');

const {externalHelpersPlugin} = require('./babel-bridge');
const {getPreset} = require('./babel-bridge');
const {inlineRequiresPlugin} = require('./babel-bridge');
const {makeHMRConfig} = require('./babel-bridge');
const {resolvePlugins} = require('./babel-bridge');
const {transformSync} = require('@babel/core');

import type {Transformer, TransformOptions} from './JSTransformer/worker';
import type {Plugins as BabelPlugins} from 'babel-core';

const cacheKeyParts = [
  fs.readFileSync(__filename),
  require('babel-plugin-external-helpers/package.json').version,
  require('babel-preset-fbjs/package.json').version,
  require('babel-preset-react-native/package.json').version,
];

/**
 * Return a memoized function that checks for the existence of a
 * project level .babelrc file, and if it doesn't exist, reads the
 * default RN babelrc file and uses that.
 */
const getBabelRC = (function() {
  let babelRC: ?{extends?: string, plugins: BabelPlugins} = null;

  return function _getBabelRC(projectRoot) {
    if (babelRC !== null) {
      return babelRC;
    }
github orta / react-native-45-typescript-example / transformer / upstream.js View on Github external
const babel = require('babel-core');
const crypto = require('crypto');
const externalHelpersPlugin = require('babel-plugin-external-helpers');
const fs = require('fs');
const generate = require('babel-generator').default;
const inlineRequiresPlugin = require('babel-preset-fbjs/plugins/inline-requires');
const json5 = require('json5');
const makeHMRConfig = require('babel-preset-react-native/configs/hmr');
const path = require('path');
const resolvePlugins = require('babel-preset-react-native/lib/resolvePlugins');

const { compactMapping } = require("react-native/packager/src/Bundler/source-map")

const cacheKeyParts = [
  fs.readFileSync(__filename),
  require('babel-plugin-external-helpers/package.json').version,
  require('babel-preset-fbjs/package.json').version,
  require('babel-preset-react-native/package.json').version,
];

/**
 * Return a memoized function that checks for the existence of a
 * project level .babelrc file, and if it doesn't exist, reads the
 * default RN babelrc file and uses that.
 */
const getBabelRC = (function() {
  let babelRC = null;

  return function _getBabelRC(projectRoot) {
    if (babelRC !== null) {
      return babelRC;
    }

babel-plugin-external-helpers

This plugin contains helper functions that’ll be placed at the top of the generated code

MIT
Latest version published 8 years ago

Package Health Score

78 / 100
Full package analysis

Popular babel-plugin-external-helpers functions