diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a7ee5307c..1f73b1e58 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,7 @@ You are welcome to contribute to this project. Here are the guidelines we try to * [Installing Grunt](#installing-grunt) * [Configuring The Server](#configuring-the-server) * [Starting The Server](#starting-the-server) - * [Building Project](#building-project) + * [Building the Project](#building-the-project) * [Coding](#coding) * [Running Tests](#running-tests) * [Functional Tests](#functional-tests) @@ -333,7 +333,14 @@ make start You should now have a local instance of the site running at `http://localhost:5000/`. Please [file bugs](https://github.com/webcompat/webcompat.com/issues/new) if something went wrong! -### Building Project +### Building the Project + +You need to build the project before serving it from a webserver will work, and after certain kinds of changes are made. + +* CSS: a build will run cssnext, combine custom media queries, and concat all source files into webcompat.dev.css. You'll need to re-build the CSS to see any changes, so it's recommended to use a watch task (see `make watch` or `grunt watch`). +* JS: a build will run eslint, minify and concat source files. +* HTML templates: the changes should be served from disk without the need for rebuilding +* Python: the Flask local server will detect changes and restart automatically. No need to re-build. You can build the entire project (CSS and JavaScript files and optimize images) by executing this command on Mac/Linux: @@ -355,6 +362,7 @@ grunt make watch ``` +By default, a build will *not* optimize images (which is done before deploys). If you'd like to do that, you can run `grunt imagemin`. ## Running Tests diff --git a/Gruntfile.js b/Gruntfile.js index 90de471a3..d77064b24 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -23,6 +23,11 @@ module.exports = function(grunt) { // Default task. grunt.registerTask('default', [ + 'checkDependencies', 'eslint', 'concat', 'uglify','cssnext', 'cssmin' + ]); + + // Task used before doing a deploy (same as default, but does image optimization) + grunt.registerTask('deploy', [ 'checkDependencies', 'eslint', 'concat', 'uglify','cssnext', 'cssmin', 'imagemin' ]); };