I found myself re-writing the same basic gulpfile. For access anywhere and getting new projects up and running faster.
- Sass to CSS
- Writing Node JS modules that get built into client side JS
- Transpiling ES6 JS
- Transpiling React JS(X)
- Linting
- Minifying
- Watching
- Testing
.
+-- css/
+-- sass/
+-- js/
+-- js_public/
+-- node_modules/
+-- react/
+-- .sass-lint.yml
+-- gulpfile.js
+-- package.json
- Either running
gulp watch
or not, write sass styles insass/
, react code inreact/
or whatever flavor of JS injs/
. - If the
watch
command is running, simply save the file you're working on and linting, testing, and building all take place automatically with the built output going to the correct folder. For sass that'scss/
. JS and React code both get dumped intojs_public/
. - If
watch
is not running, you're free to do a complete build by simply runninggulp
or run any of the tasks independently. See below for tasks. - If you want to minify code, pass the
--minify
flag to any task command.
Default. Runs all tasks: linting, testing, and building.
Waits for changes in source code. Runs all tasks.
Lints code. No built output. Define Sass lint rules in .sass-lint.yml
Runs tests. No built output.
Outputs minified code. Use this for production.