DanielSchaffer / webpack-babel-multi-target-plugin

A Webpack plugin that works with Babel to allow differential loading - production deployment of ES2015 builds targeted to modern browsers, with an ES5 fallback for legacy browsers.
153 stars 14 forks source link

use single runtime chunk will cause error #56

Open Austaras opened 4 years ago

Austaras commented 4 years ago

set webpack config

optimization: {
    runtimeChunk: 'single',
}

will cause ERROR in TypeError: Cannot read property 'options' of undefined

Austaras commented 3 years ago

This is not fixed, it will cause vendor.js loaded in both preset. @DanielSchaffer can you reopen this?

DanielSchaffer commented 3 years ago

In this scenario, does the vendor.js have mixed ES levels? It might be possible that if the stuff that gets put into the vendor chunk is already ES5 / "legacy" compatible, it could just use that for both bundles.

Austaras commented 3 years ago

No. I tested it with typescript-plain which should generate a vendor.js with only core-js and regenerator-runtime, it should never be loaded in modern target