Easy Stencil.js component library integration with Nuxt.js.
:warning: Known issue: Mismatching nodes during client-side hydration
Install with yarn:
yarn add nuxt-stencil
Install with npm:
npm install nuxt-stencil
nuxt.config.js
module.exports = {
modules: ['nuxt-stencil'],
stencil: {
/**
* Required options
*/
// Your library name, or the path to its root folder.
lib: 'bulmil',
// The prefix to whitelist
prefix: 'bm-',
/**
* Options below are optional
*/
// Stencil rendering options
renderOptions: {},
// By default, it takes the lib name. e.g: bulmil/dist/hydrate
hydratePath: null,
// By default, it takes the lib name. e.g: bulmil/dist/loader
loaderPath: null,
// By default, it takes the prefix. e.g: [/bm-\w*/]
ignoredElements: null,
},
};
This module has multiple functionalities:
render:route
& generate:page
, it will render the stencil components before sending back the request to the browser.Vue.config.ignoredElements
to ignore custom elements from your stencil library.yarn install
or npm install
yarn dev
or npm run dev