You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
问题
在
fighting-design执行pnpm build之后,会进行组件打包,那么在start目录引入打包的dist目录的时候,默认引入的是lib/index因为组件库内部分别打包了
es和cjs模块,按照我的理解在 vue 中应该是会指向es/index,更何况在package.json中已经配置了:{ "type": "module", "module": "es/index", "main": "lib/index" }那么为什么默认的引入路径加载的是
lib/index呢?测试
在
start目录下,我新增了 test 目录,下面有三个文件:{ "name": "test", "version": "1.0.0", "main": "index.cjs", "module": "index.mjs" }然后在
main.ts中引入测试发现控制器打印的日志为
我是 ES6 模块,说明package.json的配置是生效的,但是为什么我的打包之后就不生效呢?Beta Was this translation helpful? Give feedback.
All reactions