From f3e1a16fe580641e9209016915e8ba745b53894e Mon Sep 17 00:00:00 2001 From: Stewart Duffy Date: Thu, 14 Apr 2016 11:53:53 +1200 Subject: [PATCH] Adds support for preLoaders in custom webpack config (#107) * Adds support for preLoaders in custom webpack config * Changes the way it loads custom webpacck config to more generic way. Support for postLoaders --- dist/server/config.js | 3 +-- src/server/config.js | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/server/config.js b/dist/server/config.js index f0d0abe3378f..7f55f32c4bd7 100644 --- a/dist/server/config.js +++ b/dist/server/config.js @@ -50,8 +50,7 @@ exports.default = function (baseConfig, configDir) { return (0, _extends3.default)({}, customConfig, config, { // We need to use our and custom plugins. plugins: [].concat((0, _toConsumableArray3.default)(config.plugins), (0, _toConsumableArray3.default)(customConfig.plugins || [])), - module: (0, _extends3.default)({}, config.module, { - // We need to use our and custom loaders. + module: (0, _extends3.default)({}, config.module, customConfig.module || {}, { loaders: [].concat((0, _toConsumableArray3.default)(config.module.loaders), (0, _toConsumableArray3.default)(customConfig.module.loaders || [])) }) }); diff --git a/src/server/config.js b/src/server/config.js index 2be900af9404..1393904998dd 100644 --- a/src/server/config.js +++ b/src/server/config.js @@ -56,6 +56,7 @@ export default function (baseConfig, configDir) { module: { ...config.module, // We need to use our and custom loaders. + ...customConfig.module || {}, loaders: [ ...config.module.loaders, ...customConfig.module.loaders || [],