Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Commit

Permalink
fix(@angular-devkit/build-angular): support server sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin authored and Brocco committed May 16, 2018
1 parent 91b1d85 commit 046b290
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { WebpackConfigOptions } from '../build-options';
export function getServerConfig(wco: WebpackConfigOptions) {

const config: any = {
devtool: wco.buildOptions.sourceMap ? 'source-map' : false,
resolve: {
mainFields: [
...(wco.supportES2015 ? ['es2015'] : []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,19 @@ describe('Server Builder', () => {
}),
).subscribe(undefined, done.fail, done);
}, Timeout.Standard);

it('supports sourcemaps', (done) => {
const overrides = { sourceMap: true };

runTargetSpec(host, { project: 'app', target: 'server' }, overrides).pipe(
tap((buildEvent) => {
expect(buildEvent.success).toBe(true);

const fileName = join(outputPath, 'main.js');
const content = virtualFs.fileBufferToString(host.scopedSync().read(normalize(fileName)));
expect(content).toMatch(/AppServerModuleNgFactory/);
expect(host.scopedSync().exists(join(outputPath, 'main.js.map'))).toBeTruthy();
}),
).subscribe(undefined, done.fail, done);
}, Timeout.Standard);
});

0 comments on commit 046b290

Please sign in to comment.