-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is next-less deprecated or not? #23022
Comments
Would also love to see less supported directly in NextJS, but here's a config I've been using in the meantime instead of next-less.
|
How to use lessLoader in next.config.js? |
I'm using this plugin which works great for less files: |
You can do something like
|
@SimplyComplexable I've added less support to next in #23185. Once that gets merged, we will not have to deal with all these work-arounds. |
@digz6666 I just hooked up that plugin as well and it does load antd fine |
You can do something like this: import styles from './home.module.less'
const Home = () => {
return (
<>
<div className={styles.titleLeft}>
</div>
</>
)
}
export default Home home.module.less file: @import '~antd/lib/style/themes/default.less';
.titleLeft {
background-color: @border-color-base !important;
} |
I have a custom index.less file where I'm overriding/making custom classes in the BEM convention so I need to import the entire custom index.less file. I had to use a workaround that uses the less compiler to compile the less file into css and then import the generated index.css file instead since next supports regualr css out of the box. package.json {
"name": "messi-ops",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "concurrently \"next dev\" \"yarn build:styles\"", // run dev server AND watch for style changes
"build": "next build",
"start": "next start",
"build:styles": "less-watch-compiler ./styles ./styles index.less" // watch for any .less file changes in `styles` and output in index.css
},
"dependencies": {
"antd": "^4.15.0",
"cheerio": "^1.0.0-rc.5",
"next": "10.1.3",
"next-plugin-antd-less": "^0.3.0",
"react": "17.0.2",
"react-dom": "17.0.2"
},
"devDependencies": {
"babel-plugin-import": "^1.13.3",
"less-watch-compiler": "^1.14.6"
}
}
this just uses https://www.npmjs.com/package/less-watch-compiler |
This comment was marked as spam.
This comment was marked as spam.
Please verify that your issue can be recreated with Why was this issue marked with the
|
This issue has been automatically closed because it wasn't verified against next@canary. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What example does this report relate to?
with-next-less
What version of Next.js are you using?
10.0.8
What version of Node.js are you using?
14.4.0
What browser are you using?
Chrome
What operating system are you using?
macOS Big Sur
How are you deploying your application?
I'm not
Describe the Bug
The next-plugins repository has been deprecated, so I cannot create an issue in that repository, but this example is using a plugin from that repository. Is there a newer alternative to that plugin? I'm getting an error that's blocking me and I'm just not sure where to make the issue.
Expected Behavior
I just want to know the status of
next-less
.To Reproduce
I just want to know the status of
next-less
.The text was updated successfully, but these errors were encountered: