How to use the metro/src/reactNativeTransformer.transform function in metro

To help you get started, we’ve selected a few metro 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 birkir / hekla / scripts / transformer.js View on Github external
module.exports.transform = ({ src, filename, options }) => {
  if (filename.endsWith('.styl')) {
    return stylusTransformer.transform({ src, filename, options });
  }

  if (filename.endsWith('.css')) {
    return cssTransformer.transform({ src, filename, options });
  }

  if (filename.endsWith('.ts') || filename.endsWith('.tsx')) {
    return typescriptTransformer.transform({ src, filename, options });
  }

  return upstreamTransformer.transform({ src, filename, options });
};