Skip to content

Commit

Permalink
fix(README): add missing module require instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
medfreeman committed Sep 4, 2017
1 parent b7d7776 commit 3192aae
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,25 @@

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

- Require `nuxt-netlify-cms` at the start of `nuxt.config.js`

```js
var netlifyCmsModule = require("nuxt-netlify-cms").default;
```

:information_source: Note the `.default` in the above snippet. It is mandatory for this module, written in ES6, to work properly.
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.

- Add `nuxt-netlify-cms` to `modules` section of `nuxt.config.js`

```js
{
modules: [
// Simple usage
"nuxt-netlify-cms",
netlifyCmsModule,

// With options
["nuxt-netlify-cms", { adminPath: "secure" }],
[netlifyCmsModule, { adminPath: "secure" }],
],

// You can optionally use global options instead of inline form
Expand Down

0 comments on commit 3192aae

Please sign in to comment.