| 52 | * @returns {number} |
| 53 | */ |
| 54 | export function getCorejsVersion () { |
| 55 | if (!corejsVersion) { |
| 56 | try { |
| 57 | // @ts-ignore |
| 58 | corejsVersion = parseInt(require('core-js/package.json').version, 10); |
| 59 | console.log(`[OptimizePlugin] Detected core-js version ${corejsVersion}`); |
| 60 | } catch (e) { |
| 61 | console.warn( |
| 62 | `[OptimizePlugin] Unable to detect installed version of core-js. Assuming core-js@${DEFAULT_COREJS_VERSION}.` |
| 63 | ); |
| 64 | corejsVersion = DEFAULT_COREJS_VERSION; |
| 65 | } |
| 66 | } |
| 67 | return corejsVersion; |
| 68 | } |
| 69 | |
| 70 | export function createPerformanceTimings () { |
| 71 | const timings = []; |