You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ng build --prod generates error if target is es6 #3191
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 7
Versions.
Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
D:\intelliJ\testcli\cli>ng --version
angular-cli: 1.0.0-beta.20-4
node: 6.2.0
os: win32 x64
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
Fresh installed angular cli. Only change the target option to es6 will cause the error.
{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es6", <<<<<<<<<<<<<<<<<<<<<<<<<<<
"typeRoots": [
"../node_modules/@types"
]
}
}
The log given by the failure.
Normally this include a stack trace and some more information.
ERROR in main.9e857c22c48e133aa50b.bundle.js from UglifyJs
SyntaxError: Unexpected token: name (AppComponent) [D:/intelliJ/testcli/cli/~/angular2-template-loader!D:/intelliJ/testcli/cli/src/app/app.component.ts:8,0][main.9e857c22c48e133aa50b.bundle.js:38265,4]
Any roadmap on making this an option? It appears that using "uglify-es" instead of "uglify-js" would make this possible - perhaps adding an option in the angular-cli config to use this version?
I don't know the larger ramifications of this proposed change - but it seems like a reasonable option.
Reacted by LanderBeeuwsaert, Ronny Mikalsen, Mariano Pardo, Kirill Groshkov and Luiz Alberto Oliveira Brasil
Having the same issue here. I'm targeting es5, but UglifyJS errors when trying to create the vendor bundle. I'm importing a couple es6 files from my node_modules. It would be nice to either use Uglify-es or transpile files before sending them to Uglify-js without having to do an ng eject.
angular-automatic-lock-bot commented on Sep 7, 2019
Activity
clydin commentedon Nov 18, 2016
Uglifyjs (and by extension the CLI) currently doesn't support es6
ddorigo commentedon Nov 18, 2016
Thanks for the info.
rtm commentedon Mar 28, 2017
Is there any workaround? Any way to select another minifier?
LanderBeeuwsaert commentedon Apr 24, 2017
So this means angular-cli is not compatible with es6 as a target?
clydin commentedon Apr 24, 2017
@LanderBeeuwsaert At this point in time, yes.
brandon-objectstudio commentedon May 10, 2017
Any roadmap on making this an option? It appears that using "uglify-es" instead of "uglify-js" would make this possible - perhaps adding an option in the angular-cli config to use this version?
I don't know the larger ramifications of this proposed change - but it seems like a reasonable option.
kirillgroshkov commentedon Aug 10, 2017
I have similar issue, but even with target="es5" (after using
pifypackage that is es6)jscharett commentedon Aug 25, 2017
Having the same issue here. I'm targeting es5, but UglifyJS errors when trying to create the vendor bundle. I'm importing a couple es6 files from my node_modules. It would be nice to either use Uglify-es or transpile files before sending them to Uglify-js without having to do an
ng eject.angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.