main.js中引入 import ElementPlus from 'element-plus',浏览器中运行时,报错require is not defined
main.js中直接使用require不报错
ReferenceError: require is not defined
at Module.../../../../hbuild_project/waiwai/node_modules/element-plus/es/index.mjs (pages-index-index.js:12)
at __webpack_require__ (index.js:854)
at fn (index.js:151)
at eval (index.vue:8)
at Object../node_modules/babel-loader/lib/index.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js?!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js?!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/using-components.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js?!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-scoped-loader/index.js!../../../../hbuild_project/waiwai/pages/index/index.vue?vue&type=script&lang=js& (pages-index-index.js:295)
at __webpack_require__ (index.js:854)
at fn (index.js:151)
at eval (null:1)
at Module.../../../../hbuild_project/waiwai/pages/index/index.vue?vue&type=script&lang=js& (pages-index-index.js:215)
at __webpack_require__ (index.js:854)
1 个回复
power啊啊
请问解决了么