vite中的插件在配置文件vue.config.js中引入后不生效
TTcom opened this issue · comments
Tom Tong commented
if you find some problems, please first read the FAQ
if you want some new feature, please know this plugin aims to let codebase work both in vite and vue-cli.
vue.config.js
const styleImport = require('vite-plugin-style-import');
module.exports = {
pluginOptions:{
vite:{
disabledTypeChecker:true,
plugins:[
styleImport({
libs: [
{
libraryName: 'vant',
esModule: true,
resolveStyle: (name) => vant/es/${name}/style
,
},
],
})
]
}
}
}
pluginOptions 打印出来是空的
PENG Rui commented
可能有语法错误,加下 VITE_DEBUG=true 启动 yarn vite 试试
Tom Tong commented
Tom Tong commented
I solved it
add default
styleImport.default