I am developing an express.js
application. In the server.js
file I have development env specific code which uses devDependencies
imports:
// server.js
import webpack from 'webpack'; // devDependency
import webpackMiddleware from 'webpack-dev-middleware'; // devDependency
...
if (app.settings.env === 'development') {
app.use(webpackMiddleware(webpack(config));
}
...
When I deploy my application to production, I will not install devDependencies
and the code will not run because these packages will not be installed.
What is the best practice for this situation?
via David Tzoor
No comments:
Post a Comment