Skip to content

Commit

Permalink
add gulp for better build process
Browse files Browse the repository at this point in the history
  • Loading branch information
danalexilewis committed Aug 6, 2020
1 parent ef11141 commit 943f433
Show file tree
Hide file tree
Showing 3 changed files with 2,498 additions and 548 deletions.
28 changes: 28 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import gulp from 'gulp'
import replace from 'gulp-replace'
import rename from 'gulp-rename'
import ignore from 'gulp-ignore'

// DL: we need to overwrite the paths of any asset that we include in the build

const copyCss = (done) => {
gulp.src(['./build/static/css/main.*.chunk.css'])
.pipe(rename('community.css'))
.pipe(gulp.dest('./js-deliver'))
done()
}

const copyJs = (done) => {
gulp.src(['./build/static/js/main.*.chunk.js'])
.pipe(rename('community.main.js'))
.pipe(gulp.dest('./js-deliver'))
gulp.src(['./build/static/js/*.chunk.js'])
.pipe(ignore.exclude('main.*'))
.pipe(rename('community.vendor.js'))
.pipe(gulp.dest('./js-deliver'))
done()
}

const defaultTasks = gulp.parallel(copyCss, copyJs)

export default defaultTasks
Loading

0 comments on commit 943f433

Please sign in to comment.