Is there a way in Next.js to separate critical CSS and non critical for each page and load non-critical asynchronously ?
I am using styled-components in my pages and components + couple of external css libraries.
Thanks!
You can use module css, but not global. Global styles can only be used in _app.js, but you can import "module" css which is a built in feature. Is this what you mean?
// Foo.js component needing third party
import '@thirdparty/dist/styles.css'
// Foo.js component with module css from you
import styles from "./Foo.module.css";
I apologize if this is not what ur looking for. I'm not entirely sure what you are in need of.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With