Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #868: Make imagemin non-default task. #869

Merged
merged 3 commits into from
Dec 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:

Expand All @@ -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

Expand Down
5 changes: 5 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
]);
};