UNPKG

1.11 kBMarkdownView Raw
1
2# Development
3
4Igo uses npm scripts, [Webpack 2](https://webpack.js.org) and [Nodemon](https://nodemon.io/).
5
6## Default npm scripts
7
8The default `npm start` script will actually run two scripts in parallel:
9- `nodemon` to start the server, and restart when a file is modified
10- `webpack` to compile your frontend assets on the fly
11
12```js
13[...]
14"scripts": {
15 "jshint": "jshint --reporter=node_modules/jshint-stylish ./app/**/*.js || true",
16 "nodemon": "nodemon app.js",
17 "start": "npm-run-all --parallel nodemon webpack",
18 "webpack": "webpack -p --progress --watch",
19 "test": "mocha"
20},
21[...]
22```
23
24## Webpack
25
26Your local `webpack.config.js` can be as short as:
27```js
28//
29const webpackConfig = require('igo').dev.webpackConfig;
30module.exports = webpackConfig;
31```
32
33You can override this default config as you like.
34Here is [the default config](/src/dev/webpack.config.js), embedded with Igo.
35
36### Nodemon
37
38Copy this `nodemon.json` file if you want to run `jshint` automatically.
39```json
40{
41 "watch": [
42 "app"
43 ],
44 "ignore": [],
45 "ext": "js json",
46 "events": {
47 "start": "npm run jshint"
48 }
49}
50```