请问如何使用vite打包出来的lib,使用vite打包出来后的lib,css文件会报错。
vite项目使用vite打包出来后的lib css文件会报错 js不会 不知道怎么办
I'm not sure if this is a feature(/enhancement) request 🤔 Could you convert it to a discussion or maybe create a bug issue?
Okay I will close this issue now and please open a bug issue and not an enhancement issue Please also respect the issue template
Hi there,@roftLin
I think you need to add the exports field to the package.json file of your vue-component project.
package.jsonaddexports
{
"exports": {
".": {
"import": "./dist/vue-component.es.js",
"require": "./dist/vue-component.umd.js"
},
"./dist/vue-component.css": {
"import": "./dist/vue-component.css",
"require": "./dist/vue-component.css"
}
}
}
This issue has been locked since it has been closed for more than 14 days.
If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Vite version. If you have any other comments you should join the chat at Vite Land or create a new discussion.