Skip to content

Commit cdef8bd

Browse files
author
Mike Taylor
committed
Merge pull request #869 from /issues/868/2
Fixes #868: Make imagemin non-default task.
2 parents f4757c2 + 0b4b599 commit cdef8bd

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

CONTRIBUTING.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You are welcome to contribute to this project. Here are the guidelines we try to
2020
* [Installing Grunt](#installing-grunt)
2121
* [Configuring The Server](#configuring-the-server)
2222
* [Starting The Server](#starting-the-server)
23-
* [Building Project](#building-project)
23+
* [Building the Project](#building-the-project)
2424
* [Coding](#coding)
2525
* [Running Tests](#running-tests)
2626
* [Functional Tests](#functional-tests)
@@ -333,7 +333,14 @@ make start
333333
334334
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!
335335
336-
### Building Project
336+
### Building the Project
337+
338+
You need to build the project before serving it from a webserver will work, and after certain kinds of changes are made.
339+
340+
* 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`).
341+
* JS: a build will run eslint, minify and concat source files.
342+
* HTML templates: the changes should be served from disk without the need for rebuilding
343+
* Python: the Flask local server will detect changes and restart automatically. No need to re-build.
337344
338345
You can build the entire project (CSS and JavaScript files and optimize images) by executing this command on Mac/Linux:
339346
@@ -355,6 +362,7 @@ grunt
355362
make watch
356363
```
357364
365+
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`.
358366
359367
## Running Tests
360368

Gruntfile.js

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ module.exports = function(grunt) {
2323

2424
// Default task.
2525
grunt.registerTask('default', [
26+
'checkDependencies', 'eslint', 'concat', 'uglify','cssnext', 'cssmin'
27+
]);
28+
29+
// Task used before doing a deploy (same as default, but does image optimization)
30+
grunt.registerTask('deploy', [
2631
'checkDependencies', 'eslint', 'concat', 'uglify','cssnext', 'cssmin', 'imagemin'
2732
]);
2833
};

0 commit comments

Comments
 (0)