-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feature: add next.js integration #29
Comments
Is Next.js 13 or 12 supported? |
@layershifter MUI is working on the zero-runtime engine (on top of linaria). Would you be able to share what's to be done for Next.js integration? I can submit a PR once the plan is clear. |
@siriwatknp first, I would check if setup the existing Webpack loader & plugin works with Next.js 13/14 and debug what breaks. So far, I was not able to do that, but Next.js must be supported, so I appreciate if somebody will at least trace the problem 🐱 |
Looks like the problem has repro callstack/linaria#1387. Needs to be debugged to get understanding what went wrong. |
As we still don't have official plugin for Next.js, and I've tried different solutions mentioned in this and other threads, none of them works for me (wyw-in-js + Next.js v14), so I chose another approach and works pretty good for us: Extracting stylesheet in a different process via
Note, if you are using const { slugify } = require('@wyw-in-js/shared')
const { toValidCSSIdentifier } = require('@wyw-in-js/processor-utils')
module.exports = {
...
// TODO: we can remove this once https://github.com/Anber/wyw-in-js/pull/63 been merged, and only override it in website
classNameSlug: (hash, title, args) => {
const slug = toValidCSSIdentifier(
`${title.charAt(0).toLowerCase()}${slugify(
args.file.replace(/(.*\/ui-kit\/)src/, 'src'),
)}`,
)
const className = `${toValidCSSIdentifier(title)}_${slug}`
return className
},
} |
You can try and use |
The current version of wyw-in-js does not provide compatibility with Next.js 14.
The text was updated successfully, but these errors were encountered: