aurelia / webpack-plugin

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

Webpack 5 support #166

Closed mlassbo closed 3 years ago

mlassbo commented 4 years ago

I'm submitting a feature request Add support for Webpack 5.

We (at Hogia Group) need to start preparing our Aurelia apps for Webpack 5. It is in beta but Webpack reccommends to use it for production. Also, Webpack 5 comes with Module Federation that might become an important part of building micro frontends using Aurelia and we need aurelia-webpack-plugin to support webpack 5 to be able to evaluate this properly. I've been in contact with webpack core member Zack Jackson @ScriptedAlchemy, the creator of Module Federation, about this and he has offered his help with the upgrade if needed.

Please tell us about your environment:

Current behavior: When upgrading to webpack 5 beta 17 build fails with the following error:

Error: Cannot find module 'webpack/lib/BasicEvaluatedExpression' Require stack:

Expected/desired behavior: Build runs without errors

elitastic commented 3 years ago

Thank you for your quick and good help! I could solve it by explicitly providing "target: 'web'" in webpack config. (I call webpack over gulp, perhaps that leads into some confusion between node and web...)

It builds successfully now, unfortunately I get the following runtime error now:

Template markup must be wrapped in a <template> element e.g. <template> <!-- markup here --> </template>

This is for my root component, which is wrapped withing a template tag (was working with previous aurelia webpack plugin).

Do you have an idea? Sorry for bothering you! :/

bigopon commented 3 years ago

@elitastic no problem at all. Thanks for the issue, it helps fix the error in advance, before others hit it 👍 For your current build issue, is the follow steps enough to reproduce:

bigopon commented 3 years ago

Also, I think we should open a new issue, so that we can avoid spamming others, as the support for v5 is already in. This is more like a bug.

josundt commented 3 years ago

Are we far away from a 5.0.0-beta1 or 5.0.0-rc1 release here?

expaso commented 3 years ago

@bigopon Thank you very much for your hard work! This enables us to upgrade our dependencies again! I hope Aurelia will be around for a very long time in the future!

thomas-darling commented 3 years ago

@bigopon Great to see the progress here - it's much appreciated! I just tried to install the plugin from the master branch, but I'm running into this error:

image

bigopon commented 3 years ago

@thomas-darling it's been fixed. I'll close this issue for now, so that we don't accidentally spam many people. Feel free to open a new issue to help with bug fixing if you run into one. Thanks everyone for the journey.

PodgeHeavin commented 3 years ago

Is there a RC or Beta version?

bigopon commented 3 years ago

@EisenbergEffect will do a release soon. Please use master for now if possible

expaso commented 3 years ago

@bigopon You're the best! Thanks a million!

josundt commented 3 years ago

When can we expect a release (alpha, beta, rc)?