最近在弄vue2到vue3的迁移,导入路由原先使用的require.context,现在改用推荐的vite工具
const files = import.meta.globEager('./module/*.ts')
直接这么写会报标题错误
需要在tsconfig.json中进行配置
{
"compilerOptions": {
"types": ["vite/client"]
}
}
增加以上配置
最近在弄vue2到vue3的迁移,导入路由原先使用的require.context,现在改用推荐的vite工具
const files = import.meta.globEager('./module/*.ts')
直接这么写会报标题错误
需要在tsconfig.json中进行配置
{
"compilerOptions": {
"types": ["vite/client"]
}
}
增加以上配置