如何防止 Angular/Webpack 在生产代码中留下对开发目录的引用

How to prevent Angular/Webpack leaving references to dev directories on production code

Angular/Webpack 正在对引用开发目录的生产(dist 文件夹)代码留下“评论”,其中包括我的用户名。

示例:

module.exports = webpack_require(/*! C:\Users\cristian.abelleira\myproject\src\main.ts */"./src/main.ts");

如何防止这种行为?

注意:我使用“ng build”命令生成/dist文件夹

angular.js: https://gist.github.com/CrAbelleira/11c2eb2d25ade5a7ac7bf34d0b8e7952

我发现了问题。这是一个错误的配置,导致命令“ng build --configuration production”与“[=”一起执行16=]--配置production”flag properly.

用这个标志编译后,引用消失了。