一位使用旧版 Firefox (50.1.0) 的客户说我公司开发的 Angular 应用程序无法加载。
经过一些调查,我找到了罪魁祸首:ng build --prod
根据 angular-cli's github doc和 Angular's official doc , ng build --prod 是
的元标志--aot --environment=prod --output-hashing=all --sourcemaps=false --extract-css=true --named-chunks=false --build-optimizer=true
这不可能是全部事实,因为当使用 ng build --prod 时,我的应用程序不会在 Firefox 50.1.0 上加载,但是当结合使用所有标志时,它可以工作。
我的问题:--prod 添加了哪些附加标志?
最佳答案
这是生产标志使用的所有内容:
- Ahead-of-Time (AOT) Compilation: pre-compiles Angular component templates.
- Production mode: deploys the production environment which enables production mode.
- Bundling: concatenates your many application and library files into a few bundles.
- Minification: removes excess whitespace, comments, and optional tokens.
- Uglification: rewrites code to use short, cryptic variable and function names.
- Dead code elimination: removes unreferenced modules and much unused code.
关于angular - 运行 ng build --prod 时到底发生了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48405206/