I am currently working on a project using angular-cli and I have configured my package.json with the following scripts:
"scripts": {
"ng": "ng",
"build": "ng build --base-href /test/",
"prod": "ng build --prod --base-href /test/"
}
According to the Angular documentation, the --prod flag detects compilation issues such as dead code. However, these issues are not caught during the development build command (which we run using npm start).
This leads to problems being detected too late in our continuous delivery process instead of during development.
I have attempted to find options in the tsconfig file documentation to avoid adding the --prod flag for development tasks, but haven't found any solutions.
I have learned that the --prod flag triggers an uglification process with uglifyJs which enforces strict compilation.
How can I instruct Angular to enforce strict compilation during the development "build" task in the same way it does with the --prod flag? (I have also tried using "use strict mode" in my files without success).
My project is built using Angular 5 with Typescript 2.x version.
Thank you in advance.