最近我将angular项目从自定义webpack配置升级到angular-cli。当我运行ng serve
时,一切都按预期工作,但是运行ng build --prod
时出现以下错误。
有人能帮我解决这个问题吗?
looger.ts
class Message {
static show(name: string) {
return (ref?: any, ...parameters: any[]): void => {
//aadditional code
};
}
}
class Options {
static level: string[] = ['error', 'warn', 'info', 'debug', 'log', 'dir'];
static moduleNames: string[] = [];
static set(level: string[], moduleNames?: string[]) {
//aadditional code
}
}
export const Log = {
error: Message.show('error'),
warn: Message.show('warn'),
info: Message.show('info'),
debug: Message.show('debug'),
log: Message.show('log'),
dir: Message.show('dir'),
options: {
set: Options.set
}
};
app.module.ts
import { Log as log } from 'logger';
@NgModule({
providers: [
{ provide: log, useValue: log }
]
})
export class AppModule {
constructor() {}
}
Message
和Options
类,错误是否会消失? - ConnorsFan