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?
The usual way is adding them in the dependencies and then in the code at runtime detect if needed and require them.