Skip to content
This repository has been archived by the owner on Jul 21, 2019. It is now read-only.

Commit

Permalink
Add heroku specific copy task (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmarklloyd committed Nov 6, 2018
1 parent edf93f1 commit 98a352e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions gulpfile.babel.js
Expand Up @@ -8,6 +8,7 @@ const plugins = gulpLoadPlugins();
const paths = {
js: ['./**/*.js', '!dist/**', '!node_modules/**', '!coverage/**', '!./server/docs/**'],
nonJs: ['./package.json', './.gitignore', './.env', './server/**/static/**'],
prodNonJs: ['./package.json', './server/**/static/**'],
docs: ['./server/docs/**'],
tests: './server/tests/*.js'
};
Expand All @@ -22,6 +23,12 @@ function copy() {
.pipe(gulp.dest('dist'))
}

function deployCopy() {
return gulp.src(paths.prodNonJs)
.pipe(plugins.newer('dist'))
.pipe(gulp.dest('dist'))
}

function babelTask(done) {
return gulp.src([...paths.js, '!gulpfile.babel.js'], { base: '.'})
.pipe(plugins.newer('dist'))
Expand All @@ -48,6 +55,9 @@ function nodemon(done) {

gulp.task('clean', clean);
gulp.task('copy', copy);
gulp.task('deployCopy', deployCopy);
gulp.task('babelTask', babelTask);
gulp.task('serve', gulp.series(clean, copy, nodemon));
gulp.task('default', gulp.series(clean, copy, babelTask));
gulp.task('deployBuild', gulp.series(clean, deployCopy, babelTask));

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"build": "gulp",
"heroku-postbuild": "npm run build",
"heroku-postbuild": "gulp deployBuild",
"lint": "esw *.js server config --color",
"lint:watch": "npm run lint -- --watch",
"start": "gulp serve",
Expand Down

0 comments on commit 98a352e

Please sign in to comment.