Skip to content
1.x
Go to file
Code

README.md

nuxtjs-drupal-ce

npm version npm downloads ci codecov License

Easily connect Nuxt.js to Drupal via custom elements.

📖 Release Notes

Pre-requisites

Setup

  1. Add nuxtjs-drupal-ce dependency to your Nuxt.js project
yarn add nuxtjs-drupal-ce # or npm install nuxtjs-drupal-ce
  1. Add nuxtjs-drupal-ce to the modules section of nuxt.config.js
{
  modules: [
    // Simple usage
    'nuxtjs-drupal-ce',

    // With options
    ['nuxtjs-drupal-ce', {
      baseURL: 'https://your-drupal.example.com'
    }]
  ]
}
  1. Get started quickly by scaffolding initial files:
$(npm bin)/nuxt-drupal-ce-init

You may also take a look at the example project.

Options

  • baseURL: The Drupal base URL. May be overridden by an environment variable DRUPAL_BASE_URL if set. Defaults to http://localhost:8888'.

  • addRequestFormat: If set to true, the _format=custom_elements URL parameter is added automatically to requests. Defaults to true.

  • addRequestContentFormat: If specified, the given value is added as _content_format URL parameter to requests. Disabled by default.

  • addVueCompiler: If enabled, the Vue compiler is added to the runtime build. This is necessary if you want to render custom elements markup on runtime. Defaults to true.

  • useProxy: If set to dev-only and nuxt is in dev-mode, the module automatically configures /api to the Drupal backend via @nuxtjs/proxy and uses it instead of the Drupal backend, such that there are no CORS issues. Other values supported are always or false.

  • axios: Options to pass-through to the drupal-ce axios instance.

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using npm run dev

Testing

Run npm run test or yarn test.

License

MIT License

Credits

Development sponsored by drunomics hello@drunomics.com

You can’t perform that action at this time.