Skip to content

Commit 382c158

Browse files
committed
fix(schematics): remove additional check #6017
1 parent ad9fe42 commit 382c158

File tree

1 file changed

+2
-5
lines changed
  • projects/igniteui-angular/schematics/ng-add

1 file changed

+2
-5
lines changed

projects/igniteui-angular/schematics/ng-add/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { logSuccess, addDependencies, overwriteJsonFile,
77
import { addResetCss } from './add-normalize';
88
import { getWorkspace } from '@schematics/angular/utility/config';
99
import { WorkspaceSchema } from '@schematics/angular/utility/workspace-models';
10-
import * as path from 'path';
1110

1211

1312
/**
@@ -19,9 +18,7 @@ function propertyExistsInWorkspace(targetProp: string, workspace: WorkspaceSchem
1918
}
2019

2120
function enablePolyfills(tree: Tree, context: SchematicContext): string {
22-
const workspace = getWorkspace(tree);
23-
const targetFile = getDefaultProjectBuildOptions(tree)['polyfills'] ||
24-
path.join(workspace.projects[workspace.defaultProject].sourceRoot, 'polyfills.ts');
21+
const targetFile = getDefaultProjectBuildOptions(tree)['polyfills'];
2522
if (!tree.exists(targetFile)) {
2623
context.logger.warn(`${targetFile} not found. You may need to update polyfills.ts manually.`);
2724
return;
@@ -54,7 +51,7 @@ function readInput(options: Options): Rule {
5451
if (options.polyfills) {
5552
const workspace = getWorkspace(tree);
5653
const targetProperty = 'es5BrowserSupport';
57-
const polyfillsFile = path.join(workspace.projects[workspace.defaultProject].sourceRoot, 'polyfills.ts');
54+
const polyfillsFile = getDefaultProjectBuildOptions(tree)['polyfills'];
5855
const propertyExists = propertyExistsInWorkspace(targetProperty, workspace);
5956
let polyfillsData = tree.read(polyfillsFile).toString();
6057
if (propertyExists) {

0 commit comments

Comments
 (0)