lisonge / vite-plugin-monkey

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

使用了js-beautify,配置externalGlobals打包后报错 #188

Closed xFeny closed 1 month ago

xFeny commented 1 month ago

使用了js-beautify,配置externalGlobals打包后报错 1728977902565 这种情况该如何解决

lisonge commented 1 month ago

Please provide the project files to reproduce this issue.

xFeny commented 1 month ago

我是在代码中import beautifyJS from "js-beautify"; 1728980023733

在vite.config.js配置externalGlobals 1728979762154 打包后浏览器就提示报错 1728979898513

lisonge commented 1 month ago

the exportVarName of js-beautify is beautifier

- cdn.unpkg("js-beautify", "xxx")
+ cdn.unpkg("beautifier", "xxx")