-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gulp): create gulp task for application
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
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PORT=5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
coverage | ||
coverage | ||
public/js/string.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']); |