库模式中不支持配置target,那默认依靠什么来保证兼容性呢 #11964
Unanswered
rainydayDY
asked this question in
Q&A
Replies: 2 comments 7 replies
-
默认 formats 是 ['es', 'umd'], 会不会是你的代码中没有较高版本的语法以至于还能运行,我这边一个项目是要通过plugin-legacy才能给低版本浏览器执行。 |
Beta Was this translation helpful? Give feedback.
5 replies
-
库模式不是不支持 plugin-legacy 吗?怎么配的 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
对于普通的模式,配置build.target或者使用@vitejs/plugin-legacy,可以保证工程在低版本的设备上运行。
但是对于库模式,我发现工程里未配置任何关于兼容性的选项,但是构建出来的代码仍旧可以运行在chrome = 57这样的低版本设备上,我好奇,是否是vite里有什么样的默认配置保障了低版本兼容呢?
官方文档提到了:“面向库的 Rollup 预设”,请问这种预设的配置是什么呢?
Beta Was this translation helpful? Give feedback.
All reactions