Production setup
See original GitHub issueIs there any suggested setup for production?
In my mind, it would be something like:
app.use(webpackDevMiddleware(compiler, {
noInfo: true
}));
if (procsss.env.NODE_ENV !== 'production') {
app.use(webpackHotServerMiddleware(compiler));
} else {
app.use((req, res) => {
const stat = require(dist + '/stat.json')
const server = require(dist + '/server')
server(stat)(req, res)
});
}
app.listen(6060, () => {
console.log('Server started: http://localhost:6060/');
});
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to build a music production setup for under $500
Beginner's Guide: How to build a music production setup for under $500. Get set up to make music at home without breaking the...
Read more >Production setup requirements - Dynamics 365 - Microsoft Learn
This article provides information about setup requirements before you can work with Production control.
Read more >Production Setup Jobs, Employment | Indeed.com
24233 Production Setup jobs available on Indeed.com. Apply to Manufacturing Specialist, CNC Machinist, Production Associate and more!
Read more >Production Setup - Frappe Framework
Production Setup. Bench is the CLI tool to manage deployments for sites based on Frappe Framework. Here are steps to deploy your frappe...
Read more >Production Run Setup Time Definition & Benchmarks | OpsDog
Production Run Setup Time measures the number of minutes required to setup an operational production run, from the completion of the last unit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve updated the README with production setup docs – https://github.com/60frames/webpack-hot-server-middleware#production-setup
@wuct Okay great – I’m not sure what @SpaceK33z would like to rename
options.serverSideRender
to but I suggestedoptions.exposeStats
although that would mean that here, we’d be abusing the fact it happens to also force it to wait for the compiler to stabilise due to an implementation detail.I also suggested having
webpack-dev-middleware
simply always wait for the compiler to stabilise but if that isn’t an option then I’d be tempted to suggest creating two options,options.alwaysWaitUntilStable
andoptions.exposeStats
so yourgoNext
function would do something like this:If that get’s changed in
webpack-dev-middleware
then I think it’d be a good idea to update the docs here to reflect that.