diff --git a/README.md b/README.md index 9f4a0e5..211a0c5 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: + - The Webpack config object. + - 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; }