futurist / rollup-plugin-es3

Make rollup compatible with ES3
MIT License
5 stars 4 forks source link

Make it based on babel #6

Open sormy opened 5 years ago

sormy commented 5 years ago

This plugin will really work better if it will be a tiny wrapper around babel with these settings:

 {
  presets: [
    ['@babel/env', {
      targets: ['IE 6'],
      loose: true,
      exclude: ['transform-function-name', 'transform-regenerator', 'transform-async-to-generator']
    }]
  ],
  plugins: [
    ['@babel/proposal-class-properties', { loose: true }],
    ['@babel/proposal-object-rest-spread', { loose: true }],
    ['module:fast-async', { promises: false }],
    'transform-es3-member-expression-literals',
    'transform-es3-property-literals'
  ]
}

Plus probably custom babel plugin could be created to strip Object.freeze() or just configure babel to pull Object.freeze() polyfill from core-js.