1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/open-hand-choerodon-ui

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
compile-rc.js 1.2 КБ
Копировать Редактировать Исходные данные Просмотреть построчно История
Vink Dong Отправлено 7 лет назад f03bd7d
const path = require('path');
const getBabelCommonConfig = require('antd-tools/lib/getBabelCommonConfig');
const replaceLib = require('antd-tools/lib/replaceLib');
const babel = require('gulp-babel');
const through2 = require('through2');
const gulp = require('gulp');
const cwd = process.cwd();
const libDir = path.join(cwd, 'lib/rc-components');
const esDir = path.join(cwd, 'es/rc-components');
function babelify(js, modules) {
const babelConfig = getBabelCommonConfig(modules);
delete babelConfig.cacheDirectory;
if (modules === false) {
babelConfig.plugins.push(replaceLib);
} else {
babelConfig.plugins.push(require.resolve('babel-plugin-add-module-exports'));
}
babelConfig.plugins.push(
require.resolve('babel-plugin-transform-proto-to-assign'),
[require.resolve('babel-plugin-transform-es2015-classes'), { loose: true }]
);
const stream = js.pipe(babel(babelConfig))
.pipe(through2.obj(function z(file, encoding, next) {
this.push(file.clone());
next();
}));
return stream.pipe(gulp.dest(modules === false ? esDir : libDir));
}
const source = [
'components/rc-components/**/*.jsx',
'components/rc-components/**/*.js',
];
const resultJs = gulp.src(source);
babelify(resultJs, false);
babelify(resultJs);

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/open-hand-choerodon-ui.git
git@gitlife.ru:oschina-mirror/open-hand-choerodon-ui.git
oschina-mirror
open-hand-choerodon-ui
open-hand-choerodon-ui
release-0.2.3