diff --git a/packages/angular_devkit/build_angular/src/utils/normalize-builder-schema.ts b/packages/angular_devkit/build_angular/src/utils/normalize-builder-schema.ts index 2a7617d489f0..63dbffd75d80 100644 --- a/packages/angular_devkit/build_angular/src/utils/normalize-builder-schema.ts +++ b/packages/angular_devkit/build_angular/src/utils/normalize-builder-schema.ts @@ -72,6 +72,6 @@ export function normalizeBuilderSchema { ).toPromise().then(done, done.fail); }); + it(`works when using deprecated 'vendorSourceMap'`, (done) => { + const overrides: Partial = { + sourceMap: { + scripts: true, + styles: true, + }, + vendorSourceMap: true, + }; + + runTargetSpec(host, browserTargetSpec, overrides).pipe( + tap((buildEvent) => expect(buildEvent.success).toBe(true)), + tap(() => { + const fileName = join(outputPath, 'vendor.js.map'); + expect(host.scopedSync().exists(fileName)).toBe(true); + const content = virtualFs.fileBufferToString(host.scopedSync().read(normalize(fileName))); + // this is due the fact that some vendors like `tslib` sourcemaps to js files + const sourcePath = JSON.parse(content).sources[0]; + expect(path.extname(sourcePath)).toBe('.ts', `${sourcePath} extention should be '.ts'`); + }), + ).toPromise().then(done, done.fail); + }); + + it('does not map sourcemaps from external library when disabled', (done) => { const overrides: Partial = { sourceMap: {