A Babel plugin (v0.1.0) that adds missing variable declarations in the root scope after wyw-in-js pre-evaluation removes some identifiers, fixing '_c is not defined' errors. Useful for projects using MUI system, emotion, or styled-components with React Refresh (Next.js, Vite). The plugin is minimal and specific—there are no alternatives with the same narrow fix. Release cadence is low; this is the only version. No breaking changes expected due to simple scope.
npm install babel-plugin-define-varVerified import paths — ran on the pinned version, not inferred.
Configures Babel plugin to fix missing variable declarations after wyw-in-js pre-evaluation with React Refresh.
Check plugin source or file an issue if nested vars are missing.
Ensure wyw-in-js is in your Babel chain and produces the missing var problem.
Add babel-plugin-define-var to your Babel plugins.
Add babel-plugin-define-var to your Babel plugins.
Ensure React Refresh is properly set up (e.g., in Next.js or Vite) and wyw-in-js config removes it.