From a13070b4174633e80d37ede754d57b3c2374803f Mon Sep 17 00:00:00 2001 From: Ahn Date: Tue, 5 Jan 2021 02:33:11 +0100 Subject: [PATCH] feat(utils): add `es2015` to `ngcc` script's properties (#701) --- jest.config.js | 5 +++-- src/utils/ngcc-jest-processor.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/jest.config.js b/jest.config.js index bda8709ffc..08976dafad 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,6 @@ -/** @typedef {import('ts-jest')} */ -/** @type {import('@jest/types').Config.InitialOptions} */ +require('./ngcc-jest-processor'); + +/** @type {import('ts-jest/dist/types').ProjectConfigTsJest} */ module.exports = { preset: 'ts-jest', globals: { diff --git a/src/utils/ngcc-jest-processor.ts b/src/utils/ngcc-jest-processor.ts index 574e163648..c29d4ebd54 100644 --- a/src/utils/ngcc-jest-processor.ts +++ b/src/utils/ngcc-jest-processor.ts @@ -43,7 +43,7 @@ if (canRunNgcc) { * Currently Jest requires `commonjs` so we only need to ask `ngcc` to produce `umd` outputs. Later when switching * to ESM, we can change to different properties to produce ESM outputs. */ - ...['main'], + ...['es2015', 'main'], '--first-only' /** compileAllFormats */, 'false', // make sure that `ngcc` runs on subfolders as well '--async',