Closed ItWorksOnMyMachine closed 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
I'm submitting a bug report
Please tell us about your environment:
Operating System: Windows 10
Node Version: 16.4.2
NPM Version: 7.18.1
JSPM OR Webpack AND Version webpack 5.43.0
Browser: all
Language: TypeScript 4.3.5
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:
What is the expected behavior? I would expect it to run in IE.
What is the motivation / use case for changing the behavior?