Skip to content

Commit

Permalink
chore(gulp): create gulp task for application
Browse files Browse the repository at this point in the history
create gulp to start the application, move the string.js file into public folder and watch for file changes
  • Loading branch information
victor nwaiwu committed Jan 8, 2017
1 parent 9e8f64f commit 011c916
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PORT=5000
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
coverage
coverage
public/js/string.js
27 changes: 27 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require('dotenv').config();

const gulp = require('gulp');
const plugins = require('gulp-load-plugins')();

const build = './public/';

gulp.task('source', () => gulp.src('./src/string.js')
.pipe(gulp.dest('./public/js'))
.pipe(plugins.connect.reload()));

gulp.task('serve', ['build', 'watch'], () => {
plugins.connect.server({
root: build,
port: process.env.PORT || 8080,
livereload: true,
fallback: `${build}index.html`
});
});

gulp.task('watch', () => {
gulp.watch('./src/string.js', ['source']);
});

gulp.task('build', ['source']);

gulp.task('default', ['serve']);

0 comments on commit 011c916

Please sign in to comment.