From a9cb000b76b30e3fd7a9f3dba6711d9f79fd940e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Tue, 27 Dec 2016 14:54:10 +0100 Subject: [PATCH] Add extend option in nuxt build config --- lib/build/webpack/client.config.js | 7 +++++++ lib/build/webpack/server.config.js | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/build/webpack/client.config.js b/lib/build/webpack/client.config.js index b471b9e6d1..0a8e1a1975 100644 --- a/lib/build/webpack/client.config.js +++ b/lib/build/webpack/client.config.js @@ -72,5 +72,12 @@ module.exports = function () { }) ) } + // Extend config + if (typeof this.options.build.extend === 'function') { + this.options.build.extend(config, { + dev: this.dev, + isClient: true + }) + } return config } diff --git a/lib/build/webpack/server.config.js b/lib/build/webpack/server.config.js index 5371f40962..09dbc80708 100644 --- a/lib/build/webpack/server.config.js +++ b/lib/build/webpack/server.config.js @@ -51,6 +51,12 @@ module.exports = function () { } config.externals = uniq(config.externals) - // Return config + // Extend config + if (typeof this.options.build.extend === 'function') { + this.options.build.extend(config, { + dev: this.dev, + isServer: true + }) + } return config }