-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
I'm trying to get the css prop of emotion to work correctly, so as far I understood I can use the inject
option and then specify the jsxFactory
and jsxFragment
.
My config looks like this:
require("esbuild")
.build({
// ...
jsxFactory: "__jsx",
jsxFragment: "__Fragment",
inject: [path.join(__dirname, "./react-shim.js")],
// ...
)}
And the react-shim.js is this:
const {
jsx: __jsx,
Fragment: __Fragment,
} = require("@emotion/react/jsx-runtime");
However the in generated code the import names get renamed:
// scripts/react-shim.js
var {
jsx: __jsx2,
Fragment: __Fragment
} = require_emotion_react_jsx_runtime_browser_cjs();
// ....
var MotionCard = import_react12.memo(import_react12.forwardRef(function MotionCard2({card, onDragEnd}, ref) {
return /* @__PURE__ */ __jsx(motion.div, {
css: {width: "10%"},
ref,
// ...
Why are the names changed? How can I make it work?
Thank you and great work with the project!
Metadata
Metadata
Assignees
Labels
No labels