const babelCore = require('babel-core');
const file = require('gulp-file');
const path = require('path');

module.exports = function (gulp, paths) {
    return function () {
        const filename = path.basename(paths.BABEL_HELPERS_SCRIPT);
        const helpers = babelCore.buildExternalHelpers();
        return file(filename, helpers, { src: true })
                .pipe(gulp.dest(path.dirname(paths.BABEL_HELPERS_SCRIPT)));
    }
};
