Skip to content

Commit ae9cc16

Browse files
committed
fix(@angular-devkit/schematics): use loose mode for collection.json
So that the collection.json can include comments and other goodies. Note that the package.json is still using require() as it is a regular node file and would fail npm anyway, so no incentive for us to make it loose.
1 parent 8625006 commit ae9cc16

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/angular_devkit/schematics/tools/node-module-engine-host.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
} from './description';
2020
import { ExportStringRef } from './export-ref';
2121
import { FileSystemEngineHostBase } from './file-system-engine-host-base';
22+
import { readJsonFile } from './file-system-utility';
2223

2324

2425
/**
@@ -51,7 +52,7 @@ export class NodeModulesEngineHost extends FileSystemEngineHostBase {
5152
const pkgJsonSchematics = require(packageJsonPath)['schematics'];
5253
if (pkgJsonSchematics) {
5354
const resolvedPath = this._resolvePath(pkgJsonSchematics, dirname(packageJsonPath), false);
54-
require(resolvedPath);
55+
readJsonFile(resolvedPath);
5556

5657
return resolvedPath;
5758
}

0 commit comments

Comments
 (0)