@fidian/angular-cli-hook-example v0.0.7
Angular-Cli-Hook-Example
A sample project to show you how to make a hook for angular-cli-hooks. It's also useful if you are diagnosing or debugging problems.
How to Include
Install the hook package.
npm install @fidian/angular-cli-hook-example
Add
angular-cli-hooks.json
to the root of your project.{ "$schema": "./node_modules/@berglund/angular-cli-hooks/schema.json", "hookPackage": "@fidian/angular-cli-hook-example" }
Update your
angular.json
by replacing all instances of@angular-devkit/build-angular
with@berglund/angular-cli-hooks
.// Old version "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { // New version "architect": { "build": { "builder": "@berglund/angular-cli-hooks:browser", "options": {
Install angular-cli-hooks to allow Angular to have hooks. This also triggers the postinstall script to augment the options schemas to allow options from the hook.
npm install @berglund/angular-cli-hooks
(Optional) Add the options to configure what files are scanned and where to save the file list. By default, this does not write a file because the destination file is empty. Setting options like this will scan for TypeScript files in your projects. Add the
filesToFindGlob
option to control what files are scanned andwriteToFile
is where a file list is written. To make sure async functions work,delayMs
configures how long to wait before finishing."architect": { "build": { "builder": "@berglund/angular-cli-hooks:browser", "options": { "delayMs": 100, "filesToFindGlob": "{src,projects}/**/*.ts", "writeToFile": "all-files.txt",