OhYee / next-dynamic-antd-theme

Demo =>https://ohyee.github.io/next-dynamic-antd-theme/
https://www.oyohyee.com/post/project_next_dynamic_antd_theme
MIT License
18 stars 4 forks source link

Cannot find module 'css-loader/lib/getLocalIdent.js' #3

Closed nothingrealhappen closed 4 years ago

nothingrealhappen commented 4 years ago

Hi, thanks for the awesome plugin, but I found the css-loader verison is 1.0 and most scenaior we won't have this version instealled.

In later css loader verison, the lib folder doesn't exist so the file css-loader/lib/getLocalIdent.js doesn't exist as well.

          return cssLoaderGetLocalIdent(
            context,
            localIdentName,
            localName,
            options
          );

Just want to know what's your idea? any better workarround?

OhYee commented 4 years ago

This is a widely used code for Ant Design + NextJS, I just copy it from the Internet. https://github.com/vercel/next.js/issues/9669#issuecomment-568949293

This code is not necessary, you can use other solutions instead, such as https://github.com/vercel/next.js/blob/canary/examples/with-ant-design/next.config.js https://github.com/vercel/next.js/blob/canary/examples/with-ant-design-less/next.config.js