7a09f88d14
When using pnpm / yarnPnP to install next.js, styled-jsx as dependency is not hoisted in the top level node_modules, it will fail when nodejs is trying to resolve `styled-jsx/style` from project directory. Re-export `styled-jsx/style` in next.js and let swc/babel plugin compile the import path it to `next/dist/shared/lib/styled-jsx` Resolves #10149 Closes #21320 Closes #9325 Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
import _JSXStyle from "next/dist/shared/lib/styled-jsx";
|
|
export const Red = ({ Component ='button' , })=>{
|
|
return <Component className={_JSXStyle.dynamic([
|
|
[
|
|
"6c7c8cee856673a7",
|
|
[
|
|
e1,
|
|
e2,
|
|
e3,
|
|
e4,
|
|
e5,
|
|
e6,
|
|
e7,
|
|
e8,
|
|
e9,
|
|
e10,
|
|
e11,
|
|
e12,
|
|
e13,
|
|
e14,
|
|
e15
|
|
]
|
|
]
|
|
])}>
|
|
|
|
|
|
|
|
{}
|
|
|
|
<_JSXStyle id={"6c7c8cee856673a7"} dynamic={[
|
|
e1,
|
|
e2,
|
|
e3,
|
|
e4,
|
|
e5,
|
|
e6,
|
|
e7,
|
|
e8,
|
|
e9,
|
|
e10,
|
|
e11,
|
|
e12,
|
|
e13,
|
|
e14,
|
|
e15
|
|
]}>{`.button.__jsx-style-dynamic-selector{--button-1:${e1};--button-2:${e2};--button-3:${e3};--button-4:${e4};--button-5:${e5};--button-6:${e6};--button-7:${e7};--button-8:${e8};--button-9:${e9};--button-10:${e10};--button-11:${e11};--button-12:${e12};--button-13:${e13};--button-14:${e14};--button-15:${e15}}`}</_JSXStyle>
|
|
|
|
</Component>;
|
|
};
|