28 lines
743 B
JavaScript
28 lines
743 B
JavaScript
import path from 'path';
|
|
|
|
import { dest } from 'gulp';
|
|
import babelify from 'babelify';
|
|
import browserify from 'browserify';
|
|
import source from 'vinyl-source-stream';
|
|
import buffer from 'vinyl-buffer';
|
|
import concat from 'gulp-concat';
|
|
|
|
const PROJECT_DIR = path.join('src', 'newsreader');
|
|
const STATIC_DIR = path.join(PROJECT_DIR, 'js');
|
|
const CORE_DIR = path.join(PROJECT_DIR, 'news', 'core', 'static');
|
|
|
|
const babelTask = () => {
|
|
const config = browserify({
|
|
entries: `${STATIC_DIR}/homepage/index.js`,
|
|
debug: true,
|
|
}).transform(babelify);
|
|
|
|
return config
|
|
.bundle()
|
|
.pipe(source('index.js'))
|
|
.pipe(buffer())
|
|
.pipe(concat('homepage.js'))
|
|
.pipe(dest(`${CORE_DIR}/core/dist/js/`));
|
|
};
|
|
|
|
export default babelTask;
|