vite编译html-docx.js提示With statements cannot be used with the “esm“ output format due to strict mode
2024-07-30Vite 无法处理、也不支持仅可在非严格模式(sloppy mode)下运行的代码。这是因为 Vite 使用了 ESM 并且始终在 ESM。解决方案很简单,直接编辑修改html-docx.js中有with的语句,将它删掉后,把大括号{}中的变量使用obj.这样去处理。详见:https://cn.vitejs.dev/guide/troubleshooting。使用pnpm run dev 编译时,提示html-docx.js文件有以下错误。经Vite官方网站查询,发现是以下原因导致的。_with statements cannot be used with the "esm" output format due to strict mo