【发布时间】:2017-04-24 19:06:53
【问题描述】:
我一直在使用 Angular 2 和 Firebase 创建 Web 应用程序, 我想启用生产模式。
main.ts
if (environment.production) {
enableProdMode();
}
环境.ts
export const environment = {
production: true
};
环境.prod.ts
export const environment = {
production: true
};
然后我尝试 ng build -prod; ng 服务,但仍然无法正常工作。
提前致谢。
【问题讨论】:
-
你使用 angular-cli 吗?
-
那么,您尝试过什么?您只需要 ng build --prod。
-
我正在使用 angular-cli,我尝试过 ng build -prod; ng 服务,但不工作
-
如果您想构建人工制品,请使用 ng build。如果您想从 cli dev 服务器为它们提供服务,请使用 ng serve。一个接一个地使用它们没有任何用处。
标签: angular production-environment