Derek Fong
May 14 · 1 min read

Hi Arman R. Tav, I have created a CodeSandbox https://codesandbox.io/s/6y8q0n23wz?fontsize=14 to demostrate how it works.

Please Note: If you are testing out Webpack’s HMR feature, you will need to:
1. Clone the CodeSandbox to your local compouter.
2. Follow the instructions from this post to set `NODE_ENV` to `development`.
3. Open two consoles:
— One for running `$ npm run build`.
— Another one for running `$ npm run start:server` (or `$ npm run start:server:env` if you are specifying environment variables in `.env`).
4. Try modifying some code and save the file(s). HMR will trigger.

Please let me know if you still encounter issues running the code — I am here to help :)

    Derek Fong

    Written by

    Web Developer • Angular • React • NativeScript • GraphQL