diff --git a/npm/ng-packs/packages/schematics/src/utils/source.ts b/npm/ng-packs/packages/schematics/src/utils/source.ts index b495e75c20..d555e2ec1f 100644 --- a/npm/ng-packs/packages/schematics/src/utils/source.ts +++ b/npm/ng-packs/packages/schematics/src/utils/source.ts @@ -106,15 +106,18 @@ export function createProxyConfigReader(targetPath: string) { export function createProxyClearer(targetPath: string) { targetPath += PROXY_PATH; + const proxyIndexPath = `${targetPath}/index.ts`; return (tree: Tree) => { try { tree.getDir(targetPath).subdirs.forEach(dirName => { - if (!['enums', 'models', 'services'].includes(dirName)) return; - - tree.delete(`${targetPath}/${dirName}`); + const dirPath = `${targetPath}/${dirName}`; + tree.getDir(dirPath).visit(filePath => tree.delete(filePath)); + tree.delete(dirPath); }); + if (tree.exists(proxyIndexPath)) tree.delete(proxyIndexPath); + return tree; } catch (_) { throw new SchematicsException(interpolate(Exception.DirRemoveFailed, targetPath));