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
*[Adding Temporary Environment Variables In Your Shell](#adding-temporary-environment-variables-in-your-shell)
89
-
*[Windows (cmd.exe)](#windows-cmdexe)
90
-
*[Linux, macOS (Bash)](#linux-macos-bash)
91
-
*[Adding Environment Variables In `.env`](#adding-environment-variables-in-env)
92
-
*[What other `.env` files are can be used?](#what-other-env-files-are-can-be-used)
93
-
*[How Razzle works (the secret sauce)](#how-razzle-works-the-secret-sauce)
94
-
*[Inspiration](#inspiration)
95
-
*[Author](#author)
96
-
*[Contributors](#contributors)
84
+
-[Quick Start](#quick-start)
85
+
-[`npm start` or `yarn start`](#npm-start-or-yarn-start)
86
+
-[`npm run build` or `yarn build`](#npm-run-build-or-yarn-build)
87
+
-[`npm run start:prod` or `yarn start:prod`](#npm-run-startprod-or-yarn-startprod)
88
+
-[`npm test` or `yarn test`](#npm-test-or-yarn-test)
89
+
-[`npm start -- --inspect` or `yarn start -- --inspect`](#npm-start------inspect-or-yarn-start------inspect)
90
+
-[`npm start -- --inspect-brk` or `yarn start -- --inspect-brk`](#npm-start------inspect-brk-or-yarn-start------inspect-brk)
91
+
-[`rs`](#rs)
92
+
-[<imgsrc="https://user-images.githubusercontent.com/4060187/37915268-209644d0-30e7-11e8-8ef7-086b529ede8c.png"width="500px"alt="Razzle Hot Restart"/>](#)
-[Adding Temporary Environment Variables In Your Shell](#adding-temporary-environment-variables-in-your-shell)
98
+
-[Windows (cmd.exe)](#windows-cmdexe)
99
+
-[Linux, macOS (Bash)](#linux-macos-bash)
100
+
-[Adding Environment Variables In `.env`](#adding-environment-variables-in-env)
101
+
-[What other `.env` files are can be used?](#what-other-env-files-are-can-be-used)
102
+
-[How Razzle works (the secret sauce)](#how-razzle-works-the-secret-sauce)
103
+
-[Inspiration](#inspiration)
104
+
-[Author](#author)
105
+
-[Contributors](#contributors)
97
106
98
107
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
99
108
@@ -155,7 +164,7 @@ Last but not least, if you find yourself needing a more customized setup, Razzle
155
164
*`process.env.REACT_BUNDLE_PATH`: Relative path to where React will be bundled during development. Unless you are modifying the output path of your webpack config, you can safely ignore this. This path is used by `react-error-overlay` and webpack to power up the fancy runtime error iframe. For example, if you are using common chunks and an extra entry to create a vendor bundle with stuff like react, react-dom, react-router, etc. called `vendor.js`, and you've changed webpack's output to `[name].js` in development, you'd want to set this environment variable to `/static/js/vendor.js`. If you do not make this change, nothing bad will happen, you will simply not get the cool error overlay when there are runtime errors. You'll just see them in the console. Note: This does not impact production bundling.
156
165
*`process.env.VERBOSE`: default is false, setting this to true will not clear the console when you make edits in development (useful for debugging).
157
166
*`process.env.PORT`: The `BUILD_TARGET=server` build listens on this port for all NODE_ENVs. default is `3000`
158
-
*`process.env.HOST`: The IP address that the server will bind to. default is `0.0.0.0`, for INADDR_ANY
167
+
*`process.env.HOST`: The IP address that the server will bind to. default is `localhost`, for INADDR_ANY
159
168
*`process.env.NODE_ENV`: `'development'` or `'production'`
160
169
*`process.env.BUILD_TARGET`: either `'client'` or `'server'`
161
170
*`process.env.PUBLIC_PATH`: Only in used in `razzle build`. You can alter the `webpack.config.output.publicPath` of the client assets (bundle, css, and images). This is useful if you plan to serve your assets from a CDN. Make sure to _include_ a trailing slash (e.g. `PUBLIC_PATH=https://cdn.example.com/`). If you are using React and altering the public path, make sure to also [include the `crossorigin` attribute](https://reactjs.org/docs/installation.html#using-a-cdn) on your `<script>` tag in `src/server.js`.
Copy file name to clipboardExpand all lines: website/pages/docs/environment-variables.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
-`process.env.REACT_BUNDLE_PATH`: Relative path to where React will be bundled during development. Unless you are modifying the output path of your webpack config, you can safely ignore this. This path is used by `react-error-overlay` and webpack to power up the fancy runtime error iframe. For example, if you are using common chunks and an extra entry to create a vendor bundle with stuff like react, react-dom, react-router, etc. called `vendor.js`, and you've changed webpack's output to `[name].js` in development, you'd want to set this environment variable to `/static/js/vendor.js`. If you do not make this change, nothing bad will happen, you will simply not get the cool error overlay when there are runtime errors. You'll just see them in the console. Note: This does not impact production bundling.
10
10
-`process.env.VERBOSE`: default is false, setting this to true will not clear the console when you make edits in development (useful for debugging).
11
11
-`process.env.PORT`: The `BUILD_TARGET=server` build listens on this port for all NODE_ENVs. default is `3000`
12
-
-`process.env.HOST`: The IP address that the server will bind to. default is `0.0.0.0`, for INADDR_ANY
12
+
-`process.env.HOST`: The IP address that the server will bind to. default is `localhost`, for INADDR_ANY
13
13
-`process.env.NODE_ENV`: `'development'` or `'production'`
14
14
-`process.env.BUILD_TYPE`: `'iso'` for isomorphic/universal applications or `'spa'` for single page applications. The default is `'iso'`. This is set by CLI arguments.
15
15
-`process.env.BUILD_TARGET`: either `'client'` or `'server'`
0 commit comments