Moudlarized gulp tasks which makes for a cleaner root gulpfile
Inspired by this Medium post
These gulp tasks expect the following file structure in order to work properly
.
/src
/client // Public-facing JS, will be compiled to ./public/js
/server // Serverside JS, will be compiled to ./dist
/scss // Sass files, will be compiled to ./public/css
/dist // Holds compiled serverside code from ./src/server
/public // Holds public JS/CSS, compiled from ./src/client and ./src/scss
Contains tasks that build files (JS, stylesheets, etc)
Modules in this folder can export a function called watchFunction
which can be run in the watch task.
Browserify bundle the public JS found in ../src/js
.
Bundle the sass found in ../src/scss
Run the serverside JS through Babel
Defines the task gulp.task('watch')
.Calls the watchFunction
exported in the modules in ./build