Skip to content

Commit

Permalink
Try re-using babel CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Feb 21, 2019
1 parent 1338aed commit 73e7797
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

const { src, dest, series, parallel, lastRun } = require('gulp')
const { include } = require('gulp-ignore')
const gulpBabel = require('gulp-babel')
const del = require('del')
const yamlToJson = require('gulp-yaml')

const { BUILD, BUILD_DIST } = require('../files')
const { getWatchTask } = require('../watch')
const gulpExeca = require('../exec')

const clean = () => del(BUILD_DIST)

Expand All @@ -18,10 +18,9 @@ const copy = () =>
}).pipe(dest(BUILD_DIST))

const babel = () =>
src(`${BUILD}/**`, { dot: true, since: lastRun(babel), sourcemaps: true })
.pipe(include(/\.(js)$/u))
.pipe(gulpBabel({ comments: false, minified: true, retainLines: true }))
.pipe(dest(BUILD_DIST, { sourcemaps: '.' }))
gulpExeca(
`babel ${BUILD} --out-dir ${BUILD_DIST} --source-maps --no-comments --minified --retain-lines`,
)

const yaml = () =>
src(`${BUILD}/**`, { dot: true, since: lastRun(yaml) })
Expand Down

0 comments on commit 73e7797

Please sign in to comment.