Migrate from v1 to v2
Breaking Changes
Plugin
Plugin has been removed.
To register entries during runtime, the composable useCustomElement
is now used.
Plugin implementation:
<script>
export default {
created () {
this.$customElements.registerEntry('example');
}
}
</script>
Composable implementation:
<script setup>
import { useCustomElements } from '#imports';
const { registerEntry } = useCustomElements();
registerEntry('example');
</script>
Builder
Nuxt 3 supports the following builders:
Vite
Webpack
This is controlled by the Nuxt option builder
.
If builder @nuxt/webpack-builder
is set, the custom elements will also be a webpack build.
nuxt.config
builder: '@nuxt/webpack-builder',
Beware of .ce.vue.
It is not recommended to use the file extension .ce.vue
.
With this setting the components are used as CustomElement during runtime (Dev/Server) and incorrect views may occur.
Table of Contents