Skip to content

Commit c0e040f

Browse files
resolve build issue
1 parent 5e4b82e commit c0e040f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ng-add/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { addPackageJsonDependency, NodeDependency, NodeDependencyType } from 'sc
44

55
function addPackageJsonDependencies(): Rule {
66
return (host: Tree, context: SchematicContext) => {
7-
7+
88
// always add the package under dev dependencies
99
const dependencies: NodeDependency[] = [
1010
{ type: NodeDependencyType.Dev, version: '~3.1.0', name: '@netlify-builder/deploy' }
1111
];
12-
12+
1313
dependencies.forEach(dependency => {
1414
addPackageJsonDependency(host, dependency);
1515
context.logger.log('info', `✅️ Added "${dependency.name}" into ${dependency.type}`);
@@ -22,7 +22,7 @@ function addPackageJsonDependencies(): Rule {
2222
function getWorkspace(host: Tree): { path: string; workspace: experimental.workspace.WorkspaceSchema } {
2323
const possibleFiles = ['/angular.json', './angular.json'];
2424
const path = possibleFiles.find(path => host.exists(path));
25-
const configBuffer = host.read(path);
25+
const configBuffer = path ? host.read(path) : undefined;
2626

2727
if (!path || !configBuffer) {
2828
throw new SchematicsException(`Could not find angular.json`);

0 commit comments

Comments
 (0)