feat(webpack): read nativescript.config.ts main if set before fallback to package.json (#9769)

implements #9658

BREAKING CHANGES:

Possibly breaking if a project has a main field set in the nativescript.config.ts - since after this lands, this value will be used instead of package.json main.

The impact is likely very small, the steps to migrate:

    (Option A) remove main from nativescript.config.ts if set
    (Option B) update main to the correct path in nativescript.config.ts if set incorrectly
This commit is contained in:
Igor Randjelovic
2022-02-18 13:39:04 +01:00
committed by GitHub
parent cb7bd2a401
commit 61ff7e4762
5 changed files with 67 additions and 8 deletions

View File

@ -13,10 +13,10 @@ jest.mock('cosmiconfig', () => ({
},
}));
const getValueMock = jest.fn();
getValueMock.mockImplementation((key, defaultValue) => defaultValue);
jest.mock('../src/helpers/config.ts', () => ({
getValue(key, defaultValue) {
return defaultValue;
},
getValue: getValueMock,
}));
jest.mock('os', () => {