SolidZORO / next-plugin-antd-less

🎩 Use Antd (Less) with Next.js v12, Zero Dependency on other Next-Plugins.
MIT License
345 stars 48 forks source link

webpack 5 problem #41

Closed amirjr1378 closed 3 years ago

amirjr1378 commented 3 years ago

when i use future: { webpack5: true, } yarn build or dev give me error like screenshot image

SolidZORO commented 3 years ago

Wait for Next.js to enable webpack5 by default, and I'll support it.

elado commented 3 years ago

I also needed webpack 5 support, ended up creating a package:

dryleaf commented 3 years ago

I am dying for webpack5 support. I cannot use other plugins due to errors of next-plugin-antd-less.

lgenzelis commented 3 years ago

Since next 10.2, webpack is enabled by default 🎉

dryleaf commented 3 years ago

@SolidZORO Please enable webpack 5 on this package. @lgenzelis Is right, Next.js 10.2 is released with webpack 5 enabled by default. https://nextjs.org/blog/next-10-2

SolidZORO commented 3 years ago

I just tried it and found that removing handleAntdInServer is working on dev, but not build. this will take some time to fix, especially since I have to get familiar with webpack5. so I'll deal with it later.

SolidZORO commented 3 years ago

I also needed webpack 5 support, ended up creating a package:

hi,this plugin working at next.js 10.2 with antd less?

dryleaf commented 3 years ago

I tried that plugin with antd less, it doesn't not work for me. Because the antd css styles are not applied and did not find a way to inject with babel plugin. Your package is the only thing that works for me. You just need to work on webpack 5 support for it.

SolidZORO commented 3 years ago

@dryleaf Yes, I understand. I looked at webpack5 today and a lot of the syntax has changed so that some of the dependencies like null-loader are also not available anymore, officially they say you can use resolve.alias = false instead, but I don't know how to go about completing this.

So for now I'll keep it webpack4 only, and when I figure out how to migrate to webpack5, I'll finish it with webpack5 compatibility, but I'm not sure how long it will take, maybe up to a month.

elado commented 3 years ago

hi,this plugin working at next.js 10.2 with antd less?

Yes. Tested with 10.1 and 10.2 and antd. There could be some cases/configs I haven't handled. I tried to keep the package as small and as resilient to next changes as possible.

lgenzelis commented 3 years ago

I tried that plugin with antd less, it doesn't not work for me. Because the antd css styles are not applied and did not find a way to inject with babel plugin. Your package is the only thing that works for me. You just need to work on webpack 5 support for it.

@dryleaf I created a PR for @elado's plugin, to add an option to customize antd variables. So hopefully that'll be solved soon.

dzcpy commented 3 years ago

Is it working with webpack 5 now?

amirjr1378 commented 3 years ago

yes sir

On Mon, May 10, 2021 at 4:29 PM dzcpy @.***> wrote:

Is it working with webpack 5 now?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SolidZORO/next-plugin-antd-less/issues/41#issuecomment-836608910, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALWJULDOHLTISKARXSB5MVTTM7DCVANCNFSM43IAQ62Q .

ianldgs commented 3 years ago

I can confirm: it works and the build went down 1 minute for me. Thanks for the great plugin and this update, @amirjr1378!