Build, Serve and Watch: gulp
Running gulp in the Jumpstart folder will compile the sources to dist then start a local Browsersync instance on port 3000 to serve and refresh your pages as you
edit.
The default task runs the following operations:
- clean:dist : The
distfolder is emptied. All files indistare deleted. - html: All
.htmlfiles are copied frompagestodist. Only newer files are copied. - sass-min: Compiles
theme.cssandtheme.min.cssfromscss/theme.scssto thedist/assets/cssalong with appropriate.mapfiles. - bootstrap-js: Compiles and minifies all Bootstrap javascript files to
bootstrap.jsandbootstrap.min.jsin thedist/assets/jsfolder. - mrare-js: Compiles and minifies all Medium Rare javascript files to
theme.jsandtheme.min.jsin thedist/assets/jsfolder. - copy-assets: Copies any newer files from
pages/assetstodist/pages/assets. - serve: Starts a Browsersync instance on port
3000served fromdist, defaults toindex.html. - watch: Monitors the following files and runs the corresponding tasks:
pages/*.html, then runs the html task.scss/*.scss, then runs the sass-min task.js/bootstrap/*.js: then runs the bootstrap-js task.js/mrare/*.js: then runs the mrare-js task.assets/*.*: then runs the copy-assets task.
NOTE: Medium Rare javascript is linted through gulp-eslint according to the Airbnb rules preset, and
is configured in the .eslintrc.json file in the project root. If the linting fails, the Gulp process will quit with an error. If you edit any Medium Rare javascript files and encounter a linting error, simply correct the
error and re-run gulp. This is done to prevent distribution of unlinted code.
The Browsersync server and Gulp's watch task will continue to run until instructed to quit via Ctrl+C or if the terminal/command window is closed.
When the server process quits, the dist folder is left intact with the latest version of compiled files within.