I have to following imports at my entry point but the promise polyfill is still loaded.
import configurator from 'core-js/configurator'
configurator({ useNative: ['Promise'] })
import 'core-js/es/promise'
I understand that firefox doesn't have a full promise implantation, but it's fine for my needs. As I understood it setting useNative should cause the promise polyfill to only be loaded if there's no native implementation regardless of the correctness of that implementation.
imports are hoisted, so import "core-js/es/promise runs before calling the configurator.
@nicolo-ribaudo yep here should be require, but README examples use import and seem even with require it's broken in the actual version.
Nope, I incorrectly tested it, with require it works as expected. So the bug only in the documentation.
If you need an esm-compatible workaround:
// configure-core-js.js
import configurator from 'core-js/configurator'
configurator({ useNative: ['Promise'] })
// entry point
import "./configure-core-js.js";
import 'core-js/es/promise';
imports are hoisted, soimport "core-js/es/promiseruns before calling the configurator.
Of course. Silly me. Thank you.