Currently, I am working on a TypeScript project that is compiled with the setting "target": "es5"
. In order to use core-js's Set
, I have both core-js and @types/core-js installed in my project. The issue arises because the core-js d.ts file contains global declarations for ES6 features such as Set
and Map
. This causes the TypeScript compiler to allow me to use these features, even though they may not be supported in older browsers.
Unfortunately, I cannot exclude the core.d.ts file from the build process since it contains necessary interfaces that I need. Is there a way for the TypeScript compiler to prevent me from using ES6 features while still allowing me to use core-js and its corresponding type definitions?