You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm using rollup to build my application and I'm getting some warning because rollup understands as a global module as can see in the follow image:
Describe the solution you'd like
My suggestion is spread the version on import, something like:
import { version as emotionReactVersion } from '@emotion/react/package.json'
...
const __EMOTION_VERSION__ = emotionReactVersion
Hey @felipe-silva-devtech, to be frank I don't think that your suggestion fixes your problem.
It may change the warning text, because packageInfo was inferred from our import, but it doesn't solve anything.
You are building an UMD build with Rollup, and it expects the package.json from Emotion to be assigned to a global variable. It doesn't know that variable, because you did not set output.globals, and it guesses packageInfo.
Thing is, I don't think there is such a global variable. Moreover, Theme UI doesn't build to UMD, so there won't be a global variable for it too. Are you confident that you need an UMD build? ESM and CJS builds are usually enough for the most common cases.
Activity
hasparus commentedon Nov 22, 2022
Hey @felipe-silva-devtech, to be frank I don't think that your suggestion fixes your problem.
It may change the warning text, because
packageInfowas inferred from our import, but it doesn't solve anything.You are building an UMD build with Rollup, and it expects the package.json from Emotion to be assigned to a global variable. It doesn't know that variable, because you did not set
output.globals, and it guessespackageInfo.Thing is, I don't think there is such a global variable. Moreover, Theme UI doesn't build to UMD, so there won't be a global variable for it too. Are you confident that you need an UMD build? ESM and CJS builds are usually enough for the most common cases.