rollup / rollup-plugin-commonjs

This module has moved and is now available at @rollup/plugin-commonjs / https://github.com/rollup/plugins/blob/master/packages/commonjs
MIT License
502 stars 126 forks source link

Added support for ancient ES3 browsers #381

Closed sormy closed 5 years ago

sormy commented 5 years ago

Added support for ancient ES3 browsers, like IE6, IE7, IE8 without breaking compatibility with modern browsers. The build output after minifiers will depend on minifier configuration. For example, uglifyjs will keep x['default'] if { ie8: true } is set and will convert back to x.default if not set. This is a safe change that will add ES3 support for free without impact on modern browsers.

Fixes #364

sormy commented 5 years ago

Hi, babel got recently merged full es3 support as a part of preset-es3 (https://github.com/babel/babel/pull/9781). It could be really nice to have rollup to also support es3 and the change needed for commonjs is pretty small. Let me know if I can do anything else to move forward with this PR. Thank you.

lukastaegert commented 5 years ago

Hi @sormy,

I will not make any promises for Rollup itself supporting ES3 any time soon—not too long ago, we removed legacy mode as it was basically too hard to maintain without proper ES3 environment tests and there is a lot of different auto-generated code that will not work in such an environment. Nevertheless, I could see us accomodate this specific change as long as this is not seen as a promise to become fully ES3 compliant.