Polyfills and package.json optionalDependencies

旧巷老猫 提交于 2020-01-06 03:09:21

问题


I'm working on a library that require some polyfills in some environments. Is correct to add the polyfills as optionalDependencies in the package.jso file?


回答1:


The usual way is adding them in the dependencies and then in the code at runtime detect if needed and require them.



来源:https://stackoverflow.com/questions/36602912/polyfills-and-package-json-optionaldependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!