How to use the @ngtools/webpack/src/transformers.makeTransform function in @ngtools/webpack

To help you get started, we’ve selected a few @ngtools/webpack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NativeScript / nativescript-dev-webpack / transformers / ns-replace-bootstrap.ts View on Github external
factoryModulePath,
                    firstNode,
                    true,
                ),

                // Replace the bootstrap call expression. For example:
                // from: platformNativeScriptDynamic().bootstrapModule(AppModule);
                // to:   platformNativeScript().bootstrapModuleFactory(__NgCli_bootstrap_2.AppModuleNgFactory);
                new ReplaceNodeOperation(sourceFile, bootstrapCallExpr, newBootstrapCallExpr),
            );
        });

        return ops;
    };

    return makeTransform(standardTransform, getTypeChecker);
}
github NativeScript / nativescript-dev-webpack / transformers / ns-support-hmr-ng.ts View on Github external
let ops: TransformOperation[] = [];

        if (!entryPath || normalize(sourceFile.fileName) !== normalize(entryPath)) {
            return ops;
        }

        try {
            ops = handleHmrSupport(sourceFile);
        } catch (e) {
            ops = [];
        }

        return ops;
    };

    return makeTransform(standardTransform, () => getNgCompiler().typeChecker);
}
github ng-qt / ng-qt / packages / devkit / src / transformers / import-polyfills.ts View on Github external
ops.push(
        ...insertAllImport(sourceFile, 'reflect-metadata', firstNode, true),
        ...insertAllImport(
          sourceFile,
          'zone.js/dist/zone-node',
          firstNode,
          true,
        ),
      );
    }

    return ops;
  };

  return makeTransform(standardTransform, getTypeChecker);
}