An advanced workflow setup for frontend projects using npm scripts
instead of grunt/gulp.
git clone https://github.com/gyopiazza/workflow
cd workflow
npm install
Tasks can be executed with npm run <taskname>
Delete existing dist
files
Add vendor prefixes to your CSS automatically
Compile SCSS to CSS
"Lint" your JavaScript to enforce a uniform style and find errors
Uglify (minify) a production ready bundle of JavaScript
Compress all types of images
Compress separate SVG files and combine them into one SVG "sprite", along with creating the SCSS source.
Start a new server and watch for CSS & JS file changes in the dist
folder
Adds a source code comment banner (with copyright information) to the minified CSS and JS files.
Watches for any .scss file in src
to change, then runs the build:css
task
Watches for any .js file in src
to change, then runs the build:js
task
Watches for any images in src
to change, then runs the build:images
task
Run the following tasks simultaneously: serve
, watch:css
& watch:js
. When a .scss or .js file changes in src
, the task will compile the changes to dist
, and the server will be notified of the change. Any browser connected to the server will then inject the new file from dist
Alias to run the scss
and autoprefixer
tasks. Compiles Scss to CSS & add vendor prefixes
Lints JS, combines src
JS files & uglifies the output
Alias to run the sprite
and imagemin
tasks. Compresses images, generates an SVG sprite from a folder of separate SVGs
Clean the dist
folder before running build:all
Alias to run build:css
, build:js
& build:images
commands in sequence
TODO: BUILD FOR PRODUCTION (images compression, copyright-banner, etc...)
Runs unit tests with mocha
on all the files in the tests/unit
folder
Runs integration tests with mocha
on all the files in the tests/integration
folder
Runs visual tests with backstop
following the settings in backstop.json
Creates the visual tests reference with backstop
following the settings in backstop.json
to be matched against
Runs jsdoc
to generate the Javascript documentation of the codebase.
Runs watch:all
after npm install
is finished