Open kmiyashiro opened 4 years ago
module.loaders
were deprecated since webpack 2 and are now removed in favor ofmodule.rules
.
as per webpack's To v4 from v3 page
I fixed this by pulling async-plugin.js
into our codebase and changing it to this.
export default function asyncPlugin(config) {
let babel = config.module.rules.filter(loader => loader.loader && loader.loader.includes('babel-loader'))[0].options;
// Blacklist regenerator within env preset:
babel.presets[0][1].exclude.push('transform-async-to-generator');
// Add fast-async
babel.plugins.push([require.resolve('fast-async'), { spec: true }]);
}
This shouldn't be necessary in preact-cli 3, since most browsers will be loading the modern JS bundles that use native async/await.
preact build output:
at ode_modules/preact-cli-plugin-async/dist/async-plugin.js:1:51
Which corresponds to this:
Could be the change from webpack 3 to 4.