vue-cropper
vue-cropper copied to clipboard
The requested module 'vue-cropper' is a CommonJS module
Named export 'VueCropper' not found. The requested module 'vue-cropper' is a CommonJS module, which may not support all module.exports as named exports.
咱们这个库没有配置好ESM,可以参考一下 vitepress的问题 有个naive-ui库也是这个问题,已经解决了
还有个错误, E:\my-workspace\xh-bms\xh-admin-frontend\node_modules\vue-cropper\dist\vue-cropper.es.js:1 import { defineComponent as M, openBlock as C, createElementBlock as x, withDirectives as O, createElementVNode as v, normalizeStyle as y, vShow as X, createCommentVNode as b, normalizeClass as S, toDisplayString as H } from "vue"; ^^^^^^
SyntaxError: Cannot use import statement outside a module
应该也是一样的问题,大佬修复一下。
现在js越来越严格了,CommonJS和ESModule的导入最好不要混用,尤其是类库,如果用ES规范导入,文件扩展名用.mjs更好。
ok 这个我可升级打包配置应该可以
@xyxiao001 感谢大佬
这个问题还没有解决?使用的1.1.1版本打包还是存在这个问题