You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Webpack Dev Server should automatically open up http://localhost:2000 in your web browser. If it does not, open a browser and navigate to port 2000. The hot reloader will automatically reload when files are modified in the `/src/` directory.
125
122
126
-
Webpack-dev-server is running in the container and hot-reloading when changes are made locally.
123
+
#### Run the Production Build
127
124
128
-
All node modules are installed within the container, so make sure to rebuild your container if you make changes to package.json (see step 2, above).
125
+
```bash
126
+
# run the build (note: you may need to use `sudo` priveledges to run the build successfully)
127
+
npm run build
128
+
```
129
+
Please add tests for your code before posting a pull request.
129
130
130
-
For more information about contributing with Docker, see the [README in ./docker](https://github.com/mac-s-g/react-json-view/blob/master/docker/README.md).
131
+
You can run the test suite with `npm run test` or `npm run test:watch` to automatically reload when files are modified.
131
132
132
-
#### Standard Workflow
133
-
Development workflow is setup for linux users with Docker installed. You can contribute with other configurations but I have not tested them.
133
+
#### Docker Tools
134
+
135
+
I recommend using docker for development because it enforces environmental consistency.
136
+
137
+
For information about contributing with Docker, see the [README in ./docker](https://github.com/mac-s-g/react-json-view/blob/master/docker/README.md#contributing-to-this-project-using-docker).
134
138
135
-
1. Clone this repo
136
-
2. Install npm dependencies
137
-
```
138
-
cd react-json-view
139
-
npm install --save-dev
140
-
```
141
-
3. Run webpack to start webpack-dev-server with hot-reloading enabled
142
-
*`npm run dev:hot`
143
-
4. Open port 2000 in your browser
144
-
* navigate to localhost:2000
145
139
146
140
### Inspiration
147
141
I drew a ton of design ideas from [react-json-tree](https://github.com/alexkuz/react-json-tree). Thanks to the RJT contributors for putting together an awesome component!
Copy file name to clipboardExpand all lines: docker/README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,33 @@
1
+
### Contributing to this Project Using Docker
2
+
#### Run the Dev Server
3
+
To use Docker to run the source code in a local development environment:
4
+
1. Clone this repo
5
+
2. Build the docker image
6
+
*`cd react-json-view`
7
+
*`./docker/build-container.sh`
8
+
**note:* you may need to use `sudo` to run docker commands
9
+
3. Run the docker container on port 2000. This will run the webpack-dev-server with hot-reloading enabled.
10
+
*`./docker/dev-server.sh`
11
+
**note:* you may need to use `sudo` to run the server file
12
+
4. Open port 2000 in your browser
13
+
* navigate to localhost:2000
14
+
15
+
Your source code will be mounted inside the docker container. The container is built on the latest `Node:slim` image.
16
+
17
+
Webpack-dev-server is running in the container and hot-reloading when changes are made locally.
18
+
19
+
All node modules are installed within the container, so make sure to rebuild your container if you make changes to package.json (see step 2, above).
20
+
21
+
#### Run the Production Build
22
+
```bash
23
+
cd react-json-view
24
+
# build the rjv container
25
+
./docker/build-container.sh
26
+
# run the build within your docker container
27
+
./docker/build-dist.sh
28
+
```
29
+
30
+
1
31
### Motivation for adding Docker to your Development Stack
2
32
3
33
**PSA:** You do not need to use Docker to contribute to this project. If you're not interested in using a container for development, you can ignore this directory.
0 commit comments