How to use the @babel/register.revert function in @babel/register

To help you get started, we’ve selected a few @babel/register 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 smooth-code / smooth.js / packages / smooth / src / babel / require.js View on Github external
export default function babelRequire(path) {
  register({ presets: [preset] })
  // eslint-disable-next-line global-require, import/no-dynamic-require
  const mod = require(path)
  revert()
  return mod
}

@babel/register

babel require hook

MIT
Latest version published 17 days ago

Package Health Score

95 / 100
Full package analysis