How to use the @babel/standalone/babel.js.registerPlugin function in @babel/standalone

To help you get started, we’ve selected a few @babel/standalone 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 EffectNode / EffectNode-GUI / src / components / parts / EffectNode / ExecEnv / babel.worker.js View on Github external
import requirejsSrc from './str/requirejs.str.txt'
import polyfill from './str/babelpolyfill.str.txt'

var uglify = require('uglifyjs-browser')

console.trace = v => {
  if (v !== 'The node type SpreadProperty has been renamed to SpreadElement') {
    console.log(v)
  }
}

// var dynamicImport = require('babel-plugin-syntax-dynamic-import')
// Babel.registerPlugin('syntax-dynamic-import', dynamicImport)

var dynamicSpread = require('babel-plugin-transform-object-rest-spread')
Babel.registerPlugin('transform-object-rest-spread', dynamicSpread)

var umd = require('babel-plugin-transform-es2015-modules-umd')
Babel.registerPlugin('transform-es2015-modules-umd', umd)

var es6 = [
  [ 'transform-object-rest-spread', { 'useBuiltIns': true } ],
  [
    'transform-es2015-modules-umd',
    {
      exactGlobals: true
    }
  ]
]

var compile = ({ path, src }) => {
  return new Promise((resolve, reject) => {
github EffectNode / EffectNode-GUI / src / components / parts / EffectNode / ExecEnv / babel.worker.js View on Github external
var uglify = require('uglifyjs-browser')

console.trace = v => {
  if (v !== 'The node type SpreadProperty has been renamed to SpreadElement') {
    console.log(v)
  }
}

// var dynamicImport = require('babel-plugin-syntax-dynamic-import')
// Babel.registerPlugin('syntax-dynamic-import', dynamicImport)

var dynamicSpread = require('babel-plugin-transform-object-rest-spread')
Babel.registerPlugin('transform-object-rest-spread', dynamicSpread)

var umd = require('babel-plugin-transform-es2015-modules-umd')
Babel.registerPlugin('transform-es2015-modules-umd', umd)

var es6 = [
  [ 'transform-object-rest-spread', { 'useBuiltIns': true } ],
  [
    'transform-es2015-modules-umd',
    {
      exactGlobals: true
    }
  ]
]

var compile = ({ path, src }) => {
  return new Promise((resolve, reject) => {
    var output

    try {