Skip to content

Commit

Permalink
Add nodemon and ts-node for incremental compilation
Browse files Browse the repository at this point in the history
`npm run start-server` to begin developing backend components. The
frontend can be started in a separate terminal using `npm start`.
Webpack-dev-server will automatically proxy all `/api` calls to the
server on port 8080
  • Loading branch information
leonm1 committed Feb 1, 2019
1 parent f85a204 commit 1aa5989
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ignore": ["**/*.test.ts", "**/*.spec.ts", ".git", "node_modules"],
"watch": ["src/server"],
"exec": "npm run start-server",
"ext": "ts"
}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@
"friendly-errors-webpack-plugin": "^1.7.0",
"html-webpack-plugin": "^3.2.0",
"image-webpack-loader": "^4.6.0",
"nodemon": "^1.18.9",
"passport-google-oauth2": "^0.1.6",
"prettier": "^1.15.3",
"svg-inline-loader": "^0.8.0",
"thread-loader": "^2.1.1",
"ts-node": "^8.0.2",
"typescript": "^3.2.2",
"typescript-eslint-parser": "^21.0.2",
"webpack": "^4.28.3",
Expand All @@ -117,6 +119,8 @@
"url": "git+https://github.com/vu-cs3892-s19/vaken.git"
},
"scripts": {
"start-server": "ts-node src/server/index.ts",
"dev-server": "./node_modules/nodemon/bin/nodemon.js",
"build": "tsc && webpack --config webpack.prod.js --progress --colors",
"prod": "npm run build && node ./dist/server/index.js",
"format": "prettier --config .prettierrc.json --write \"./**/*.ts*(x)\"",
Expand Down
1 change: 1 addition & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = merge.smart(common, {
hot: true, // Enable hot module replacement
open: true, // Open browser on 'npm start'
quiet: true, // Pretty console output
port: 8081,
proxy: {
'/api': {
target: 'http://localhost:8080',
Expand Down

0 comments on commit 1aa5989

Please sign in to comment.