-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular CLI can't run minify process on CKEditor (ES6 code) #7709
Comments
Hi! I'm one of CKEditor 5's developers. This issue was brought to us by @mswilson4040 and, I have to say, it was a pretty big surprise. We've recently dropped compat (ES5) builds because we assumed that one either ships for browsers which support ES6 (all browsers which CKE5 supports at the moment have sufficient ES6 support to run it) or they can easily enable ES6 to ES5 transpilation. Not being able to load ES6 library using Angular CLI came as a surprise. We'll reconsider bringing back ES5 builds (https://github.com/ckeditor/ckeditor5-build-classic/issues/24), but using them will have one significant downside – they are bigger (in terms of code size) than what many Angular apps might need to ship.
I saw a couple of issues about Angular CLI and ES6 output, but none about including ES6 libraries. Was this topic already discussed? |
Heya, we actually added ES2015 support very recently (#7610), and you can use it with We don't, however, have support for automatically transpiling ES6 code to ES5. This means that if you are using es2015 support, you are shipping es2015 code. There's been some talk about doing this sort of thing, and for using We assume that libraries are shipping ES5 (possibly with es6 modules) in the I agree that there are many benefits to using es2015, but packaging es2015 in |
Thanks! That's great news :) I see that we need to research this a bit more on our side. Right now, I'd prefer if we shipped ES6 by default. Or in other words – shipping two formats will make sense only if popular bundlers would pick ES6 if they support it. I'm going to check how they handle the |
I've confirmed this works on my end. I think this can be closed. |
Closing as per @mswilson4040's comment. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
1.4.1
Repro steps.
1.) git clone https://github.com/mswilson4040/ckangular.git
2.) npm install
3.) ng build --prod --aot
The log given by the failure.
Desired functionality.
Either an option to transpile es6 down to es5 or some option to access webpack (without ng eject). It would be really nice if angular-cli would sniff out any es6 and automatically transpile it down to es5 or leverage a different plugin that supports es6.
Mention any other details that might be useful.
CKEditor5 is in developer preview right now and has an upcoming alpha release. The big thing about CKEditor5 is it works with webpack as opposed to CKEditor 4 and below. However, CKEditor is written in ES6 so when we run a production build with the angular cli, UglifyJs throws in error on the vendor.bundle. I have an open ticket with CKEditor as well but it looks like the root cause is angular cli uses webpack UglifyJs plugin which doesn't support ES6 code. The problem eventually bubbles up pointing fingers at angular cli and the lack of access to modify the webpack config.
https://ckeditor5.github.io/
ckeditor/ckeditor5#560
The text was updated successfully, but these errors were encountered: