I managed to achieve what I wanted with parallel tasks, copyfiles and npm watch:
npm dev dependencies:
"npm-watch": "^0.1.8",
"parallelshell": "^2.0.0",
"copyfiles": "^1.2.0",
package.json snippet:
"watch": {
"copy-files": "dist/*.js"
},
"scripts": {
"ng": "ng",
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor",
"watch": "npm-watch",
"copy-files": "copyfiles src/** dist/** ../angular",
"ng-build": "ng build -w",
"build": "parallelshell \"ng build\" \"npm run watch\" "
},
Then
npm run build
FWIW the watch config is saying, if anything in dist/*.js changes, run the "copy-files" npm script...