-
Notifications
You must be signed in to change notification settings - Fork 880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to deploy for production? #13
Comments
Normally you'll have a separate Webpack config for production. You would remove hot replacement plugin and references to dev server there, and instead add Uglify minification plugin. Then, you'd run |
Hi @gaearon and @mewben , I've similar question, in my webpack config I did something like this var PROD = JSON.parse(process.env.PROD_DEV || "0");
module.exports = {
devtool: 'eval',
entry: PROD ?
[
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./scripts/index'
]
:
["./scripts/index"]
,
output: {
path: path.join(__dirname, 'build'),
filename: PROD ? "bundle.min.js" : 'bundle.js',
publicPath: '/scripts/'
},
plugins: PROD ?
[
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
(new webpack.optimize.UglifyJsPlugin({minimize: true}))
]
:
[
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
] then I run PROD_DEV=1 webpack..this generate the minified file but I notice than this still is doing request to my dev server GET http://localhost:3000/socket.io/?EIO=3&transport=polling&t=1441324914560-29 net::ERR_CONNECTION_REFUSED am I missing disable the server in some place?...my config file doesnt seems have other reference to the server |
+1 |
"0" would be truthy. You can just do |
Yep, that’s the problem. |
Let’s track in #63. |
No description provided.
The text was updated successfully, but these errors were encountered: