How to solve the problem that the declaration file cannot be found

Problem description: Pinia-plugin-persist: The plug-in cannot find the declaration file when applied in vue2 + ts.

You can see the declaration file by looking in the installation directory.

Analysis: There is a type declaration file, but it cannot be found, indicating that there is a problem with the export of package.json

Check package.json and find that the export configuration is missing the type

So just add export configuration items when exporting

"types":"./dist/index.d.ts"

Supongo que te gusta

Origin blog.csdn.net/weixin_71452134/article/details/132005885
Recomendado
Clasificación