Skip to content

Commit

Permalink
fix(@schematics/angular): tsconfig.json can't be parsed if it contain…
Browse files Browse the repository at this point in the history
…s comments

Fixes #13455
Closes #13456
  • Loading branch information
Alan Agius authored and hansl committed Jan 18, 2019
1 parent 757bca4 commit 6c0b4db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/schematics/angular/library/index.ts
Expand Up @@ -5,7 +5,7 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { parseJson, strings } from '@angular-devkit/core';
import { JsonParseMode, parseJson, strings } from '@angular-devkit/core';
import {
Rule,
SchematicContext,
Expand Down Expand Up @@ -54,7 +54,7 @@ function updateJsonFile<T>(host: Tree, path: string, callback: UpdateJsonFn<T>):
const source = host.read(path);
if (source) {
const sourceText = source.toString('utf-8');
const json = parseJson(sourceText);
const json = parseJson(sourceText, JsonParseMode.Loose);
callback(json as {} as T);
host.overwrite(path, JSON.stringify(json, null, 2));
}
Expand Down

0 comments on commit 6c0b4db

Please sign in to comment.