ERROR from UglifyJs Unexpected character '@'

ERROR from UglifyJs Unexpected character '@'



I am getting below error when my Angular 6 App build as ng build ---prod


ng build ---prod



ERROR in scripts.28e0dfadf7f39e74e940.js from UglifyJs Unexpected
character '@' [scripts.28e0dfadf7f39e74e940.js:13,0]



What could be the issue?



tsconfig.json



"compileOnSave": false,
"compilerOptions":
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]






do you have any external script defined in your angular.json ?
– YoukouleleY
Aug 23 at 10:12





@YoukouleleY Yeah. node_modules/chart.js/dist/Chart.min.js and a ts file with custom functions for Pipe, PipeTransform
– Bishan
Aug 23 at 10:20



node_modules/chart.js/dist/Chart.min.js


Pipe, PipeTransform





as already answered, you can't import typescript files in there
– YoukouleleY
Aug 23 at 10:27




1 Answer
1



UglifyJS does not support ES2015 or higher. Decorators are not yet part of any ES specification, hence they are not supported. You have to transpile them firstly.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)