gpt4 book ai didi

vue.js - Vue3 webcomponents 生产构建问题

转载 作者:行者123 更新时间:2023-12-05 05:46:31 27 4
gpt4 key购买 nike

我正在尝试将我的 vue2 webcomponent 迁移到 vue3,但在我为生产创建构建时出现了问题。

我使用带有 --target wc 的 vue-cli 现在显示一条错误,指出 vue3 webcomponent 支持仍在开发中。

删除 --target 选项我的构建文件有很大不同,我依赖于没有此选项的 .min 文件不会被构建。

我有什么选择? vite 是否提供与之前 vue-cli 为 vue2 提供的相同构建输出?

最佳答案

现在 - 2022 年 5 月 - vue-cli-service 完全不支持 --target wc事实上在源代码中它是完全禁用的

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

关于vue.js - Vue3 webcomponents 生产构建问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71164127/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com