Skip to content

Commit

Permalink
add server-side debug command to package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
bnchdrff committed Mar 1, 2018
1 parent 88724ab commit 8be08ba
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ full-fledged site relying on your own, we recommend looking into running a
copy of `steemd` locally instead
[https://github.com/steemit/steem](https://github.com/steemit/steem).

#### Debugging SSR code

`yarn debug` will build a development version of the codebase and then start the
local server with `--inspect-brk` so that you can connect a debugging client.
You can use Chromium to connect by finding the remote client at
`chrome://inspect/#devices`.

#### Configuration

The intention is to configure condenser using environment variables. You
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"precommit": "lint-staged",
"production": "NODE_ENV=production node lib/server/index.js",
"start": "NODE_ENV=development babel-node ./webpack/dev-server.js",
"debug": "NODE_ENV=development webpack --config ./webpack/debug.config.js && rm -rf ./lib && babel src --source-maps --out-dir lib -D && node --inspect-brk lib/server/index.js",
"checktranslations": "node scripts/check_translations.js",
"storybook": "start-storybook -p 9001 -c .storybook",
"storybook-build": "build-storybook -c .storybook -o docs"
Expand Down
28 changes: 28 additions & 0 deletions webpack/debug.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const webpack = require('webpack');
const git = require('git-rev-sync');
const baseConfig = require('./base.config');

module.exports = {
...baseConfig,
devtool: 'cheap-module-eval-source-map',
output: {
...baseConfig.output,
publicPath: '/assets/',
},
module: {
...baseConfig.module,
rules: [
...baseConfig.module.rules,
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
BROWSER: JSON.stringify(true),
NODE_ENV: JSON.stringify('development'),
VERSION: JSON.stringify(git.long()),
}
}),
...baseConfig.plugins,
],
};

0 comments on commit 8be08ba

Please sign in to comment.