My version of starter project for JS applications. Includes gulp for workflow automation, babel for ES6 syntax transpilation, eslint for linter according to Airbnb JavaScript Style Guide.
To setting up starter project run following command:
npm init
It should install all node modules, required for application.
The project includes following directories:
/app - public directory for internal webserver
/app/dist - compiled version of all .js files
/src - source files of project
.babelrc, .eslintignore, .editorconfig, .eslintrc, .gitignore - project configuration files
gulpfile.babel.js - gulp tasks description
package.json - required modules description
Gulpfile includes following tasks:
- lint
- lint:fix
- clean
- compile
- webserver
- watch
- build
- default
gulp lint
Output result will show how many SLOC had unmatched rules according to linter config
gulp lint:fix
Same as previous, but also trying to fix errors if it's possible
gulp clean
Cleanup /app/dist path
gulp compile
Put compiled (transpiled) version of js to /app/dist path
gulp webserver
Starting webserver. Be care webserver includes live reloading rule
gulp watch
Starting watcher for tracking file changes in /src directory
gulp build
Build task, depends on additional parameters called browser/cli building strategy
gulp default
Starting webserver after linter, compile jobs and keeping watcher for source files. If any changes occured inside /src directory than all process will start again
gulp command [--build]
Additional parameter to show in which case build strategy executes. Supports browser/cli values.
gulp command [--production]
Parameter to execute, when lib is preparing for production mode. Includes uglify functionality
Fill free to use any part of code for yor own project and good luck