Skip to content

Commit

Permalink
Merge pull request #3367 from webcompat/issue/3362/1
Browse files Browse the repository at this point in the history
Fixes #3362 - Remove grunt tasks and clean up package.json
  • Loading branch information
ksy36 authored Jul 1, 2020
2 parents 9968555 + e184cfb commit 6300c39
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 380 deletions.
47 changes: 0 additions & 47 deletions Gruntfile.js

This file was deleted.

3 changes: 1 addition & 2 deletions config/deploy.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ docs/
env/
fabfile.py*
git_modules/
grunt-tasks/
Gruntfile.js
webpack/
icon-licenses/
Makefile
node_modules/
Expand Down
32 changes: 21 additions & 11 deletions docs/dev-env-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,36 +261,46 @@ The logs are saved in the file `webcompat.log`.

After certain kinds of changes are made, you need to build the project before serving it from a webserver will work.

- CSS: a build will run cssnext, combine custom media queries, and concat all source files into webcompat.dev.css. You'll need to rebuild the CSS to see any changes, so it's recommended to use a watch task (see `npm run watch`).
- JS: a build will run eslint and minify, and concat source files.
- JS templates (`.jst` files): if you are making changes to a Backbone template in a `.jst` file, you will need to re-run the `build` command to update the pre-compiled `templates.js` file before you will see the results.
- 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 rebuild.
- HTML templates: the changes should be served from disk without the need for rebuilding.
- JS and CSS: We use webpack for asset bundling.

You can build the entire project (CSS stylesheets, JavaScript scripts, and optimized images) by executing this command on macOS/Linux:
See main webpack commands below:

You can build the entire project (CSS stylesheets, JavaScript code) by executing this command
in a new terminal tab:

```bash
npm run build
```

and this command on Windows:
This build is meant for development and does not include optimizations for production.
Note that this command will not watch for changes in JS or CSS.

If you need to watch for changes and rebuild the assets on the fly, run this command instead:

```bash
npm run watch
npm run dev
```

Linting means that you check that the code respects some syntactic rules defined for this project.
We use linting, which will check that the code respects some syntactic rules defined for this project.
To run linters:

```bash
# linting style, JS and python.
# linting style, JS, CSS and python.
npm run lint
```

Fixing static JS files with project coding styles, if an error occurs:

```bash
# fixing linting style JS
npm run fix
npm run lint:fix:js
```

By default, a build will _not_ optimize images (which is done before deploys). If you'd like to optimize images, you can run `npm run imagemin`.
or CSS:

```bash
# fixing linting style CSS
npm run lint:fix:css
```
16 changes: 0 additions & 16 deletions grunt-tasks/cmq.js

This file was deleted.

90 changes: 0 additions & 90 deletions grunt-tasks/concat.js

This file was deleted.

25 changes: 0 additions & 25 deletions grunt-tasks/cssmin.js

This file was deleted.

33 changes: 0 additions & 33 deletions grunt-tasks/cssnext.js

This file was deleted.

34 changes: 0 additions & 34 deletions grunt-tasks/imagemin.js

This file was deleted.

30 changes: 0 additions & 30 deletions grunt-tasks/jst.js

This file was deleted.

40 changes: 0 additions & 40 deletions grunt-tasks/uglify.js

This file was deleted.

Loading

0 comments on commit 6300c39

Please sign in to comment.