在进行vue项目打包的时候出现了bug。
项目能够正常运行,但是一打包会出现如下错误:
error TS6504: File '***' is a JavaScript file. Did you mean to enable the 'allowJs' option?
The file is in the program because:
Root file specified for compilation
在网络上查找大多让重启vscode,但重启后仍报上述错误。
9 回答1.7k 阅读✓ 已解决
6 回答976 阅读
3 回答5.8k 阅读✓ 已解决
3 回答1.4k 阅读✓ 已解决
4 回答969 阅读✓ 已解决
2 回答1.1k 阅读✓ 已解决
3 回答875 阅读
两种办法, 在你配置文件里加入 allowjs:true
或者你直接把你的.js的文件改成.ts,也许就可以了