Angular custom file change detection

I am building an Angular app that uses markdown files (.md) to generate my terms of use, privacy policy, etc. pages.

/help
 +- terms-of-use.component.md
 +- terms-of-use.component.html
 +- terms-of-use.component.ts

I have a custom script that converts the .md files to html and it is registered as prestart and prebuild steps:

package.json file excerpt...

"scripts": {
    "ng": "ng",
    "prestart": "node transformMarkdown.js",
    "start": "ng serve --host localhost --port 4200 --disable-host-check --configuration local",
    "prebuild": "node transformMarkdown.js",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
},

And it works great! Whenever I run npm run start or npm run build, my script detects that the .md file has changed and updates the html file. For example:

> npm run start
> [email protected] prestart
> node transformMarkdown.js

Generating... terms-of-use.component.html

> [email protected] start
> ng serve --host localhost --port 4200 --disable-host-check --configuration local

Now I am trying to get Angular to auto-detect the .md file changes and regenerate the html file automatically just it would with a change to any other file. I cannot figure out how to do this.

I believe that at its core, the problem lies in (not just in file change detection), but also that I launched ng serve using node (npm start). Is it possible to get this to work by just using ng serve (and have it detect the .md file changes)?

Any ideas would be appreciated 🙂