Skip to content

Commit

Permalink
🩹 fix(patch): use transform.react.importSource for swc
Browse files Browse the repository at this point in the history
  • Loading branch information
kellymears committed Oct 7, 2024
1 parent 803310f commit dd25e80
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
20 changes: 10 additions & 10 deletions sources/@repo/yarn-plugin-bud/bundles/@yarnpkg/plugin-bud.js

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions sources/@roots/bud-emotion/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ export class BudEmotion extends Extension<NonNullable<unknown>, null> {
import.meta.url,
)
if (isString(emotionPlugin))
bud.swc.setPlugins((plugins = []) => [
...plugins,
[emotionPlugin, {}],
])
bud.swc
.setPlugins((plugins = []) => [...plugins, [emotionPlugin, {}]])
.setTransform((options = {}) => ({
...options,
react: {
...(options.react ?? {}),
importSource: `@emotion/react`,
},
}))
}
}
}

0 comments on commit dd25e80

Please sign in to comment.