fix(ngcc): do not write entry-point manifest outside node_modules (#36299)

Fixes #36296

PR Close #36299
This commit is contained in:
Pete Bacon Darwin
2020-03-28 17:32:15 +00:00
committed by Alex Rickabaugh
parent 5ac308060d
commit c6dd900f60
3 changed files with 37 additions and 6 deletions

View File

@ -165,6 +165,12 @@ runInEachFileSystem(() => {
expect(fs.exists(_Abs('/project/node_modules/__ngcc_entry_points__.json'))).toBe(false);
});
it('should do nothing if the basePath is not node_modules', () => {
fs.writeFile(_Abs('/project/yarn.lock'), 'LOCK FILE CONTENTS');
manifest.writeEntryPointManifest(_Abs('/project/dist'), []);
expect(fs.exists(_Abs('/project/dist/__ngcc_entry_points__.json'))).toBe(false);
});
it('should write an __ngcc_entry_points__.json file below the base path if there is a yarn.lock file',
() => {
fs.writeFile(_Abs('/project/yarn.lock'), 'LOCK FILE CONTENTS');