'Vue3 webcomponents production build problem

I'm trying to migrate my vue2 webcomponent to vue3, although the problem comes when i'm creating a build for production.

I was using the vue-cli with --target wc which now displays an error stating that vue3 webcomponent support is still under development.

Removing the --target option my build files are way different, i was relying on the .min files that without this option are not builded.

What alternative I have? Does vite provide the same build outputs that previously vue-cli gave with vue2?



Solution 1:[1]

Now -may 2022- the vue-cli-service does not support at all --target wc In fact in the source code it is completely disabled

if (vueMajor === 3) {
    abort(`Vue 3 support of the web component target is still under development.`)
  }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Albert Tinon