问题
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