在进行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,但重启后仍报上述错误。
5 回答4.9k 阅读✓ 已解决
4 回答3.2k 阅读✓ 已解决
2 回答4.9k 阅读✓ 已解决
4 回答4.4k 阅读✓ 已解决
4 回答1.9k 阅读✓ 已解决
2 回答2.7k 阅读✓ 已解决
2 回答2.6k 阅读✓ 已解决
两种办法, 在你配置文件里加入 allowjs:true
或者你直接把你的.js的文件改成.ts,也许就可以了