How to use the buildExternalHelpers function from babel-core
Find comprehensive JavaScript babel-core.buildExternalHelpers code examples handpicked from public code repositorys.
GitHub: mzohaibqc/mui

208 209 210 211 212 213 214 215 216 217
}); } function buildCdnAngular(dirname) { var s = babelCore.buildExternalHelpers(angularBabelHelpers, 'global'); return makeTask('build-cdn-angular: ' + dirname, function() { return gulp.src('./build-targets/cdn-angular.js') .pipe(plugins.browserify({
+ 3 other calls in file
62 63 64 65 66 67 68 69 70 71
return new RawModule(buildBabelHelpers(whitelist), getModuleIdentifier(dependency)); } function buildBabelHelpers(whitelist) { if (whitelist.length) { return babelCore.buildExternalHelpers(whitelist); } return babelCore.buildExternalHelpers(); }
+ 3 other calls in file
GitHub: mairatma/babel-globals

5 6 7 8 9 10 11 12 13 14
var babelPluginGlobals = require('babel-plugin-globals'); var Concat = require('concat-with-sourcemaps'); function addUsedHelpers(concat, results) { var usedHelpers = getUsedExternalHelpers(results); concat.add(null, babel.buildExternalHelpers(usedHelpers, 'var')); } function compileToGlobals(files, options) { options = normalizeOptions(options);
GitHub: krisselden/webgl-classes

54 55 56 57 58 59 60 61 62 63
contents[destFullPath] = out.code; sourcemaps[destFullPath] = out.map; }); var babelHelpers = babel.buildExternalHelpers(usedHelpers, 'var') + '\nexport default babelHelpers;'; var babelHelpersFile = path.join(transpiledDir, 'babel-helpers.js'); fs.writeFileSync(babelHelpersFile, babelHelpers); var entryFile = path.join(transpiledDir, 'index.js');
GitHub: ipeychev/babel-globals

6 7 8 9 10 11 12 13 14 15
var globalsPluginObj = {transformer: babelPluginGlobals, position: 'after'}; function addUsedHelpers(concat, results) { var usedHelpers = getUsedExternalHelpers(results); concat.add('helpers.js', babel.buildExternalHelpers(usedHelpers)); } function compileToGlobals(files, options) { dependencies = {};
76 77 78 79 80 81 82 83 84 85
*/ function buildExternalHelpers(list, type) { var ex; try { return babel.buildExternalHelpers(list, type); } catch (ex) { if (type === 'export') return buildExports(list); } }
43 44 45 46 47 48 49 50 51 52
if (lastFile) { var out = lastFile.clone({contents: false}); out.path = path.join(lastFile.base, fileName); var usedHelpers = '' + babel.buildExternalHelpers(helpers, 'var') + '\nmodule.exports = babelHelpers;'; out.contents = new Buffer(usedHelpers); this.push(out);
GitHub: alihamze/mui

147 148 149 150 151 152 153 154 155 156
}); } function buildCdnReact(dirname) { var s = babelCore.buildExternalHelpers(babelHelpersList, 'global'); return makeTask('build-cdn-react: ' + dirname, function() { return gulp.src('./build-targets/cdn-react.js') .pipe(plugins.browserify({
GitHub: seznam/amphtml

55 56 57 58 59 60 61 62 63
* @param {!Array<!Array<string>>} usedHelpers * @param {function} cb */ function onFileThroughEnd(usedHelpers, cb) { var helpers = [].concat.apply([], usedHelpers); var content = babel.buildExternalHelpers(helpers); fs.writeFileSync('third_party/babel/custom-babel-helpers.js', content +'\n'); cb(); }
babel-core.transform is the most popular function in babel-core (393 examples)