From 1e145c8d983b292c04153e9d78a834671e159d0d Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sun, 11 Mar 2018 18:33:36 -0400 Subject: [PATCH] modify scripts and readme --- .gitignore | 2 +- README.md | 11 +++++++---- package.json | 5 ++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index bf5ffabf..98f0f889 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ #assety stuff public/css -vendor/ +public/metamaps.bundle.js node_modules npm-debug.log diff --git a/README.md b/README.md index 83e0a7f5..11979c32 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,10 @@ Start up the nodejs server which serves the UI files, the socketio realtime serv $ npm start ``` -Build the css. If you're developing and writing css, make sure that it will rebuild the css when you make changes, by running the `node-sass` process with the `-w` flag. +Build the css. If you're developing and writing css, make sure that it will rebuild the css when you make changes, by running the `npm sass:watch` process and leaving it running. ``` -$ node-sass sass/application.scss public/css/application.css # to run it once -$ node-sass -w sass/application.scss public/css/application.css # to watch it for more changes +$ npm run sass # to build the css once +$ npm run sass:watch # to watch it for more changes ``` Run the metamaps api in another terminal, on whichever port you configured in your .env file. @@ -86,4 +86,7 @@ use the forever node package. ``` $ npm install -g forever $ forever start server.js -``` \ No newline at end of file +``` + +To build the javascript file +`$ npm run build` \ No newline at end of file diff --git a/package.json b/package.json index ed1ed4a5..1a977786 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,12 @@ "scripts": { "start": "node server.js", "build": "webpack", + "sass": "node-sass sass/application.scss public/css/application.css", + "sass:watch": "node-sass -w sass/application.scss public/css/application.css", "test": "mocha-webpack --webpack-config webpack.test.config.js --require test_support/dom.js --recursive test", "eslint": "eslint src", - "eslint:fix": "eslint --fix src" + "eslint:fix": "eslint --fix src", + "postinstall": "[ \"$NODE_ENV\" === production ] && npm build && npm run sass" }, "repository": { "type": "git",