From de9b28d94d7dd48c962c9dea6853059bf7869eb1 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Wed, 20 Sep 2017 20:28:32 -0700 Subject: [PATCH] Better terminal UX --- desktop/webpack/components/App.js | 2 +- lib/webpack-dev-server.js | 7 +++---- package.json | 1 + scripts/dev.sh | 5 +++++ scripts/start.sh | 2 +- webpack.config.js | 11 +++++++++-- 6 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 scripts/dev.sh diff --git a/desktop/webpack/components/App.js b/desktop/webpack/components/App.js index 498642843e3..e0ec581041e 100644 --- a/desktop/webpack/components/App.js +++ b/desktop/webpack/components/App.js @@ -4,7 +4,7 @@ export default class App extends Component { render () { return (
- hi + hey
) } diff --git a/lib/webpack-dev-server.js b/lib/webpack-dev-server.js index b51e2c37d16..e82a8906f5c 100644 --- a/lib/webpack-dev-server.js +++ b/lib/webpack-dev-server.js @@ -11,12 +11,11 @@ app.use(require('webpack-hot-middleware')(compiler, { })) app.use(require('webpack-dev-middleware')(compiler, { quiet: true, - // noInfo: true, publicPath: config.output.publicPath, serverSideRender: true, - // stats: { - // colors: true - // } + stats: { + colors: true + } })) app.get('/webpack', (req, res, next) => { diff --git a/package.json b/package.json index b530ba31499..3266fb65413 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "acceptance-record": "sh scripts/acceptance_record.sh", "assets": "sh scripts/assets.sh", "deploy": "sh scripts/deploy.sh", + "dev": "sh scripts/dev.sh", "mocha": "sh scripts/mocha.sh", "start": "sh scripts/start.sh", "test": "sh scripts/test.sh" diff --git a/scripts/dev.sh b/scripts/dev.sh new file mode 100644 index 00000000000..918ddc1ae1a --- /dev/null +++ b/scripts/dev.sh @@ -0,0 +1,5 @@ +# !/usr/bin/bash + +set -e -x + +node -r dotenv/config --max_old_space_size=1024 . diff --git a/scripts/start.sh b/scripts/start.sh index 310c6cb839c..2c5616127c8 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -2,4 +2,4 @@ set -e -x -forever -c 'node -r dotenv/config --max_old_space_size=1024' . +forever -c 'node -r dotenv/config --max_old_space_size=1024' . --colors diff --git a/webpack.config.js b/webpack.config.js index f805a1ff5a9..e0239ab4675 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,7 +4,10 @@ const WebpackNotifierPlugin = require('webpack-notifier') const path = require('path') const webpack = require('webpack') -const { NODE_ENV } = process.env +const { + NODE_ENV, + PORT +} = process.env const config = { devtool: 'eval', @@ -29,7 +32,11 @@ const config = { ] }, plugins: [ - new FriendlyErrorsWebpackPlugin(), + new FriendlyErrorsWebpackPlugin({ + compilationSuccessInfo: { + messages: [`[Force] Listening on http://localhost:${PORT} \n`] + } + }), new ProgressBarPlugin(), new WebpackNotifierPlugin(), new webpack.DefinePlugin({