README
nuxtjs-drupal-ce - Nuxt.js Drupal Custom Elements Connector
Connects Nuxt.js with Drupal via the Lupus Custom Elements Renderer
Please refer to https://stack.lupus.digital for more info.
Pre-requisites
- A Drupal backend with the Lupus Custom Elements Renderer module installed.
Setup
- Add
nuxtjs-drupal-cedependency to your Nuxt.js project
yarn add nuxtjs-drupal-ce # or npm install nuxtjs-drupal-ce
- Add
nuxtjs-drupal-ceto themodulessection ofnuxt.config.js
{
buildModules: [
'nuxtjs-drupal-ce',
],
'drupal-ce', {
baseURL: 'https://your-drupal.example.com',
// more options...
}
}
- Get started quickly by scaffolding initial files:
rm -f layouts/default.vue && $(npm bin)/nuxt-drupal-ce-init
You may also take a look at the example project.
Options
baseURL: The Drupal base URL. Defaults to theDRUPAL_BASE_URLenvironment variable if provided, otherwise tohttp://localhost:8888.addRequestFormat: If set totrue, the_format=custom_elementsURL parameter is added automatically to requests. Defaults totrue.addRequestContentFormat: If specified, the given value is added as_content_formatURL 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 totrue.menuEndpoint: The menu endpoint pattern used for fetching menus. Defaults to 'api/menu_items/$$NAME$