aurelia / webpack-plugin

A plugin for webpack that enables bundling Aurelia applications.
MIT License
90 stars 36 forks source link

IE Broken with Webpack 5 #187

Closed ItWorksOnMyMachine closed 3 years ago

ItWorksOnMyMachine commented 3 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: I have converted a project to use webpack 5. There was a problem described here https://github.com/aurelia/webpack-plugin/issues/166 regarding aurelia-pal-nodejs. The resolution was to add target:"web" to the webpack config file. I did this and got resolution to my problem. However, the build doesn't run on IE11. According to the Webpack upgrade guide here https://webpack.js.org/migrate/5/ Webpack 5 uses es2015 (arrow functions) to reduce the size of the chunks it produces. It recommends using target: "browserslist" or target: ["web", "es5"] to resolve this. Unfortunately, that reintroduces the aurelia-pal-nodejs issue. Is there a recommendation for IE (other than stop using IE, we all long for that day, and it's coming, but it's not quite here yet for us).

Expected/desired behavior:

ItWorksOnMyMachine commented 3 years ago

I have also just created a fresh Aurelia project and upgraded all the packages. I've updated the webpack config including setting target to "web" and it built fine. Then, I changed target to ["web"] and it it started loading aurelia-pal-nodejs instead of aurelia-pal-browser. There's a repo here: https://github.com/ItWorksOnMyMachine/au-test-20210712