Skip to content

Commit

Permalink
[pigment-css] Fix emotion styled error (#41699)
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp authored Mar 29, 2024
1 parent c6c0d6b commit 9bcf6cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/pigment-css-nextjs-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"loader.js",
"next-font.js",
"next-image.js",
"third-party-styled.js",
"zero-virtual.css",
"package.json",
"LICENSE"
Expand Down
3 changes: 3 additions & 0 deletions packages/pigment-css-nextjs-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export function withPigment(nextConfig: NextConfig, pigmentConfig?: PigmentOptio
if (what.startsWith('next/font')) {
return require.resolve('../next-font');
}
if (what.startsWith('@emotion/styled') || what.startsWith('styled-components')) {
return require.resolve('../third-party-styled');
}
if (asyncResolve) {
return asyncResolve(what, importer, stack);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/pigment-css-nextjs-plugin/third-party-styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* eslint-env node */
module.exports = function DummyStyled() {
return () => () => null;
};

0 comments on commit 9bcf6cf

Please sign in to comment.