Skip to content

Commit 3192aae

Browse files
committed
fix(README): add missing module require instructions
1 parent b7d7776 commit 3192aae

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,25 @@
2626

2727
`npm i -D nuxt-netlify-cms` OR `yarn add -D nuxt-netlify-cms`
2828

29+
- Require `nuxt-netlify-cms` at the start of `nuxt.config.js`
30+
31+
```js
32+
var netlifyCmsModule = require("nuxt-netlify-cms").default;
33+
```
34+
35+
:information_source: Note the `.default` in the above snippet. It is mandatory for this module, written in ES6, to work properly.
36+
Please read [Misunderstanding ES6 Modules, Upgrading Babel, Tears, and a Solution](https://medium.com/@kentcdodds/misunderstanding-es6-modules-upgrading-babel-tears-and-a-solution-ad2d5ab93ce0) if your're interested to know why.
37+
2938
- Add `nuxt-netlify-cms` to `modules` section of `nuxt.config.js`
3039

3140
```js
3241
{
3342
modules: [
3443
// Simple usage
35-
"nuxt-netlify-cms",
44+
netlifyCmsModule,
3645

3746
// With options
38-
["nuxt-netlify-cms", { adminPath: "secure" }],
47+
[netlifyCmsModule, { adminPath: "secure" }],
3948
],
4049

4150
// You can optionally use global options instead of inline form

0 commit comments

Comments
 (0)