Starter template for react and webpack with Reflux
- Install node.js
- `git clone -o starter [email protected]:CalebMorris/react-starter.git
- npm install
npm run dev-server
Start webpack-dev-dervernpm run start-dev
Run seperate console- Visit
http://localhost:8080/
in browser
The configuration is webpack-dev-server.config.js
.
It automatically recompiles and refreshes the page when files are changed.
Also check the webpack-dev-server documentation.
npm run hot-dev-server
Start webpack-dev-derver in HMR modenpm run start-dev
Run seperate console- Visit
http://localhost:8080/
in browser
The configuration is webpack-hot-dev-server.config.js
.
It automatically recompiles when files are changed. When a hot-replacement-enabled file is changed (i. e. stylesheets or React components) the module is hot-replaced. If Hot Replacement is not possible the page is refreshed.
Hot Module Replacement has a performance impact on compilation.
npm run build
bundle clientnpm run start
start server in production mode- Visit
http://localhost:8080/
in browser
The configuration is webpack-production.config.js
.
The server is at lib/server.js
The production setting builds two configurations: one for the client (build/public
) and one for the serverside prerendering (build/prerender
).