错误消息是Uncaught ReferenceError: exports is not defined
编译后的代码包含Object.defineProperty(exports,"__esModule",{value:!0})
谷歌找到了一个解决方案:<script> var exports = {}; </script>
但Cannot find module './Index.b211c312.js'
│ index.html
└─_assets
Index.b211c312.js
index.fa062449.js
style.032a3e7d.css在index.html中
<script type="module" src="./_assets/index.fa062449.js"></script>在index.fa062449.js中
require("./Index.b211c312.js")如何解决这个问题?
发布于 2022-06-10 08:51:32
更新电子-vue-vite的最新版本,有一个修复!
https://github.com/electron-vite/vite-plugin-electron/issues/6#issuecomment-1144833465
https://stackoverflow.com/questions/65822780
复制相似问题