Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

Commit b764b11

Browse files
committed
In development, expose docs on local network host
localhost isn't useful for opening on mobile devices
1 parent 88926ce commit b764b11

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"css-loader": "^0.28.11",
3131
"html-webpack-plugin": "^3.2.0",
3232
"husky": "^1.1.2",
33+
"ip": "^1.1.5",
3334
"jest": "^23.5.0",
3435
"lint-staged": "^7.3.0",
3536
"prettier": "^1.14.3",

src/docs/index.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ function Demo() {
2727
</a>
2828
.
2929
</p>
30+
Sometimes you need an input field, here's one for a test:
31+
<input
32+
placeholder="Try me"
33+
// https://stackoverflow.com/q/2989263/5274538
34+
style={{ fontSize: '16px' }}
35+
/>
3036
</div>
3137
<div
3238
style={{

webpack.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require("path");
22
const HtmlWebpackPlugin = require("html-webpack-plugin");
3+
const ip = require("ip");
34

45
module.exports = {
56
entry: path.join(__dirname, "src/docs"),
@@ -31,6 +32,7 @@ module.exports = {
3132
devServer: {
3233
contentBase: path.join(__dirname, "docs"),
3334
port: 8000,
35+
host: ip.address(),
3436
stats: "minimal"
3537
}
3638
};

0 commit comments

Comments
 (0)