ff-stream-web

git clone git://archive.git.mtrnord.blog/MTRNord/ff-stream-web.git
Log | Files | Refs | README | LICENSE

commit b92bd0a825c66790804818393dedbfabca8620c4
parent 491ed16f2e643c9a97043c5dcc71a1b65eab4179
Author: nodkz <nodkz@mail.ru>
Date:   Thu, 21 Jan 2016 13:04:47 +0600

Fix problem with babel6 with react-transform-hmr for server script.

Problem: config.module.loaders pointed in same object in memory. So react-transform (in start.js) applies for server config too, in despite of x.target !== 'node'.

Diffstat:
Mpackage.json | 1+
Mtools/webpack.config.js | 5+++--
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/package.json b/package.json @@ -51,6 +51,7 @@ "jest-cli": "^0.8.2", "jscs": "^2.8.0", "json-loader": "^0.5.4", + "lodash.clonedeep": "4.0.1", "lodash.merge": "^4.0.1", "mkdirp": "^0.5.1", "ncp": "^2.0.0", diff --git a/tools/webpack.config.js b/tools/webpack.config.js @@ -10,6 +10,7 @@ import path from 'path'; import webpack from 'webpack'; import merge from 'lodash.merge'; +import cloneDeep from 'lodash.clonedeep'; import AssetsPlugin from 'assets-webpack-plugin'; const DEBUG = !process.argv.includes('--release'); @@ -109,7 +110,7 @@ const config = { // Configuration for the client-side bundle (client.js) // ----------------------------------------------------------------------------- -const clientConfig = merge({}, config, { +const clientConfig = merge({}, cloneDeep(config), { entry: './src/client.js', output: { path: path.join(__dirname, '../build/public'), @@ -146,7 +147,7 @@ const clientConfig = merge({}, config, { // Configuration for the server-side bundle (server.js) // ----------------------------------------------------------------------------- -const serverConfig = merge({}, config, { +const serverConfig = merge({}, cloneDeep(config), { entry: './src/server.js', output: { path: './build',