Skip to content

Add extend option #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/configManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const CMS_CONFIG_FILENAME = "config.yml";
const DEFAULTS = {
adminPath: "admin",
adminTitle: "Content Manager",
extend: undefined,
cmsConfig: {
media_folder: "static/uploads"
}
Expand Down
4 changes: 4 additions & 0 deletions src/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,9 @@ export default function webpackNetlifyCmsConfig(
);
}

if (typeof moduleConfig.extend === 'function') {
moduleConfig.extend(config, { isDev: nuxtOptions.dev })
}

return config;
}