Just recently upgraded to angular-cli version 1.0.0-rc1 by following the guidelines provided on the wiki.
The application functions properly when I execute ng serve
.
Similarly, the app works as expected when I run ng build
.
However, encountering an issue when running
ng build --target=production --environment=prod
, resulting in the following error message:
Error message displayed post ng build --target=production --environment=prod
Hash: 1e69750dbc9679bddab0
Time: 69052ms
... (error details omitted for brevity)
ERROR in main.8839163bd6c77300ac2a.bundle.js from UglifyJs
Unexpected token: name (FooterComponent) [main.8839163bd6c77300ac2a.bundle.js:7,6]
Any suggestions on how to successfully compile the app for production?
Update 1: Providing an excerpt from one of the problematic files. Notably, ColumnTypes.TEXT is a publicly accessible value. Since these are merely decorators with no external dependencies, they work flawlessly for non-production builds.
import {autoserialize} from "cerialize";
import {ManyToOne, PrimaryGeneratedColumn, Column, JoinColumn, OneToOne, OneToMany, Table, ColumnTypes, CreateDateColumn} from "./export.dtos";
@Table()
export class DTOModifier {
@PrimaryGeneratedColumn()
@autoserialize id: number;
@Column(ColumnTypes.TEXT, {nullable: true})
@autoserialize label: string;
}
Also note:
static TEXT: ColumnType;