Skip to content

Commit

Permalink
[pigment-css] Fix evaluation of undefined variables (#41569)
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp authored Mar 20, 2024
1 parent f6a89c1 commit 4ca7231
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/pigment-css-unplugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@pigment-css/react": "workspace:^",
"@wyw-in-js/shared": "^0.5.0",
"@wyw-in-js/transform": "^0.5.0",
"babel-plugin-define-var": "^0.1.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"unplugin": "^1.7.1"
},
Expand Down
1 change: 1 addition & 0 deletions packages/pigment-css-unplugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {
...rest.babelOptions,
plugins: [
['babel-plugin-transform-react-remove-prop-types', { mode: 'remove' }],
'babel-plugin-define-var', // A fix for undefined variables in the eval phase of wyw-in-js, more details on https://github.com/siriwatknp/babel-plugin-define-var?tab=readme-ov-file#problem
...(rest.babelOptions?.plugins ?? []),
],
},
Expand Down
1 change: 1 addition & 0 deletions packages/pigment-css-vite-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@pigment-css/react": "workspace:^",
"@wyw-in-js/shared": "^0.5.0",
"@wyw-in-js/transform": "^0.5.0",
"babel-plugin-define-var": "^0.1.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/pigment-css-vite-plugin/src/vite-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export default function wywVitePlugin({
...rest.babelOptions,
plugins: [
['babel-plugin-transform-react-remove-prop-types', { mode: 'remove' }],
'babel-plugin-define-var', // A fix for undefined variables in the eval phase of wyw-in-js, more details on https://github.com/siriwatknp/babel-plugin-define-var?tab=readme-ov-file#problem
...(rest.babelOptions?.plugins ?? []),
],
presets: Array.from(presets),
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4ca7231

Please sign in to comment.