D:\Camnpr git:[dev]
npm run build
> vite1@1.0.0 build
> pnpm run type-check && pnpm run build-only
> vite1@1.0.0 type-check D:\Camnpr
> vue-tsc --noEmit
src/main.ts:10:33 - error TS7016: Could not find a declaration file for module '../package/dist/vue-web-component-wrapper.es.js'. 'D:/Camnpr/package/dist/vue-web-component-wrapper.es.js' implicitly has an 'any' type.
10 import createWebComponent from '../package/dist/vue-web-component-wrapper.es.js'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in src/main.ts:10
ELIFECYCLE Command failed with exit code 2.
解决方案:
在tsconfig.json文件中添加配置:
"noImplicitAny": false,
"allowJs": true
配置后,使用import "xxx" from "xxx" 语句也不会报错了。