Skip to content

Commit 6c0b4db

Browse files
Alan Agiushansl
Alan Agius
authored andcommitted
fix(@schematics/angular): tsconfig.json can't be parsed if it contains comments
Fixes angular#13455 Closes angular#13456
1 parent 757bca4 commit 6c0b4db

File tree

1 file changed

+2
-2
lines changed
  • packages/schematics/angular/library

1 file changed

+2
-2
lines changed

packages/schematics/angular/library/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import { parseJson, strings } from '@angular-devkit/core';
8+
import { JsonParseMode, parseJson, strings } from '@angular-devkit/core';
99
import {
1010
Rule,
1111
SchematicContext,
@@ -54,7 +54,7 @@ function updateJsonFile<T>(host: Tree, path: string, callback: UpdateJsonFn<T>):
5454
const source = host.read(path);
5555
if (source) {
5656
const sourceText = source.toString('utf-8');
57-
const json = parseJson(sourceText);
57+
const json = parseJson(sourceText, JsonParseMode.Loose);
5858
callback(json as {} as T);
5959
host.overwrite(path, JSON.stringify(json, null, 2));
6060
}

0 commit comments

Comments
 (0)