SolidZORO / next-plugin-antd-less

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

How to import other .less files not from antd #43

Closed happyhunter7 closed 3 years ago

happyhunter7 commented 3 years ago

Hi @SolidZORO , I have a problem I want to import other .less filess.... In development mode using this syntax, it works import './my-path/my-styles.less' But when building the project these styles are not built and present in the build folder....also no errors appears.

Another interesting thing.....it works only when I'm using require('./my-path/my-styles.less').

So why it works with require but not with import? And how to fix it??

SolidZORO commented 3 years ago

The problem I remember from previous versions of next.js is that you must import the css file using the require syntax in _app.js or somewhere, else it won't work on prod. This may be a node server syntax issue, I'm not sure why at the moment, I'll deal with it later.