How to use fb-babel-plugin-utils - 2 common examples

To help you get started, we’ve selected a few fb-babel-plugin-utils 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 facebookincubator / fbt / packages / babel-plugin-fbt / bin / FbtCollector.js View on Github external
function transform(
  code /*: string*/,
  options /*: TransformOptions*/,
  plugins /*: Array*/,
)/*: void*/ {
  const opts = {
    ast: false,
    code: false,
    filename: options.filename,
    plugins: SyntaxPlugins.list.concat(plugins, [[fbt, options]]),
    sourceType: 'unambiguous',
  };
  babel.transformSync(code, opts);
}
github facebookincubator / fbt / packages / babel-plugin-fbt / bin / FbtCollector.js View on Github external
function transform(
  code /*: string*/,
  options /*: TransformOptions*/,
  plugins /*: Array*/,
)/*: void*/ {
  const opts = {
    ast: false,
    code: false,
    filename: options.filename,
    plugins: SyntaxPlugins.list.concat(plugins, [[fbt, options]]),
    sourceType: 'unambiguous',
  };
  babel.transformSync(code, opts);
}

fb-babel-plugin-utils

Common Babel 7 utils for FB

MIT
Latest version published 3 years ago

Package Health Score

59 / 100
Full package analysis

Popular fb-babel-plugin-utils functions