I am working on an Angular 4 application that utilizes angular-cli and webpack2.
I can successfully build the project with ng build
However, when I run ng build --prod the following error is thrown:
ERROR in main.50d83f3f70f7e607ec7a.bundle.js from UglifyJs Unexpected token: name (FilterPipe) [main.50d83f3f70f7e607ec7a.bundle.js:7,6]
I don't understand what is wrong.
Here is my filter.pipe.ts file:
import {Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'filter'
})
export class FilterPipe implements PipeTransform {
transform(items: any[], field : string, value : string): any[] {
if (!items) return [];
return items.filter(it => it[field] == value);
}
}