From d1e1ca8b9c70bde23e656192753b867ab166a260 Mon Sep 17 00:00:00 2001 From: Julien Dargelos Date: Thu, 18 Apr 2019 00:45:23 +0200 Subject: [PATCH 1/2] Add extend option --- README.md | 9 +++++++++ src/configManager.js | 1 + src/webpack.config.js | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 9f4a0e5..2cc66b1 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,15 @@ With nuxt default configuration, it will be served to `http://localhost:3000/adm adminTitle defines the html title of the page where Netlify CMS will be served. +### `extend` +- Default: `undefined` + +extend is a function you can use to customize webpack configuration. + +- Arguments: + 1. The Webpack config object. + 2. An object with the following keys (all boolean): `isDev`. + ### `cmsConfig` - Default: `{ media_folder: "static/uploads" diff --git a/src/configManager.js b/src/configManager.js index 006b622..577da34 100644 --- a/src/configManager.js +++ b/src/configManager.js @@ -16,6 +16,7 @@ const CMS_CONFIG_FILENAME = "config.yml"; const DEFAULTS = { adminPath: "admin", adminTitle: "Content Manager", + extend: undefined, cmsConfig: { media_folder: "static/uploads" } diff --git a/src/webpack.config.js b/src/webpack.config.js index 141de9e..c8af6d4 100644 --- a/src/webpack.config.js +++ b/src/webpack.config.js @@ -130,5 +130,9 @@ export default function webpackNetlifyCmsConfig( ); } + if (typeof moduleConfig.extend === 'function') { + moduleConfig.extend(config, { isDev: nuxtOptions.dev }) + } + return config; } From 75f391d969b097e5d26d32382d7ca8cefc944f2d Mon Sep 17 00:00:00 2001 From: Julien Dargelos Date: Thu, 18 Apr 2019 00:56:50 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2cc66b1..211a0c5 100644 --- a/README.md +++ b/README.md @@ -96,8 +96,8 @@ adminTitle defines the html title of the page where Netlify CMS will be served. extend is a function you can use to customize webpack configuration. - Arguments: - 1. The Webpack config object. - 2. An object with the following keys (all boolean): `isDev`. + - The Webpack config object. + - An object with the following keys (all boolean): `isDev`. ### `cmsConfig` - Default: `{