Skip to content

Commit 8be08ba

Browse files
committed
add server-side debug command to package.json
1 parent 88724ab commit 8be08ba

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ full-fledged site relying on your own, we recommend looking into running a
117117
copy of `steemd` locally instead
118118
[https://github.com/steemit/steem](https://github.com/steemit/steem).
119119

120+
#### Debugging SSR code
121+
122+
`yarn debug` will build a development version of the codebase and then start the
123+
local server with `--inspect-brk` so that you can connect a debugging client.
124+
You can use Chromium to connect by finding the remote client at
125+
`chrome://inspect/#devices`.
126+
120127
#### Configuration
121128

122129
The intention is to configure condenser using environment variables. You

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"precommit": "lint-staged",
1616
"production": "NODE_ENV=production node lib/server/index.js",
1717
"start": "NODE_ENV=development babel-node ./webpack/dev-server.js",
18+
"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",
1819
"checktranslations": "node scripts/check_translations.js",
1920
"storybook": "start-storybook -p 9001 -c .storybook",
2021
"storybook-build": "build-storybook -c .storybook -o docs"

webpack/debug.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const webpack = require('webpack');
2+
const git = require('git-rev-sync');
3+
const baseConfig = require('./base.config');
4+
5+
module.exports = {
6+
...baseConfig,
7+
devtool: 'cheap-module-eval-source-map',
8+
output: {
9+
...baseConfig.output,
10+
publicPath: '/assets/',
11+
},
12+
module: {
13+
...baseConfig.module,
14+
rules: [
15+
...baseConfig.module.rules,
16+
],
17+
},
18+
plugins: [
19+
new webpack.DefinePlugin({
20+
'process.env': {
21+
BROWSER: JSON.stringify(true),
22+
NODE_ENV: JSON.stringify('development'),
23+
VERSION: JSON.stringify(git.long()),
24+
}
25+
}),
26+
...baseConfig.plugins,
27+
],
28+
};

0 commit comments

Comments
 (0)