lisonge / vite-plugin-monkey

A vite plugin server and build your.user.js for userscript engine like Tampermonkey, Violentmonkey, Greasemonkey, ScriptCat
MIT License
1.33k stars 70 forks source link

使用@douyinfe/semi-ui cdn打包 error Unexpected "@" #24

Closed yelc66 closed 1 year ago

yelc66 commented 1 year ago

麻烦您帮忙看一下,是我导入cdn设置不对嘛,导入组件是按需引用的, Snipaste_2022-09-30_09-23-00 Snipaste_2022-09-30_09-21-43 Snipaste_2022-09-30_09-17-19

lisonge commented 1 year ago

cdn.xxx 的第1个参数应该是一个 JavaScript 表达式,显然 @DouYinFeSemiIcons 不是

lisonge commented 1 year ago

@douyinfe/semi-ui 的导出名字是 SemiUI image

@douyinfe/semi-icons 的导出名字是 SemiIcons image

很多库往往都不注明自己的 iife/umd 的导出变量名字,需要自己到 js 文件里去找

lisonge commented 1 year ago

另外你的脚本的 namespace 建议设置为你的github地址 https://github.com/yelc66

yelc66 commented 1 year ago

另外你的脚本的 namespace 建议设置为你的github地址 https://github.com/yelc66

好的,已修改,谢谢