Skip to content

Commit

Permalink
fix: add @types/babel__cores to dependencies (fix #211)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Aug 21, 2023
1 parent 4bebe5b commit 8413a18
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 29 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"ci-publish": "tsx scripts/publishCI.ts"
},
"devDependencies": {
"@types/babel__core": "^7.20.1",
"@types/fs-extra": "^11.0.1",
"@types/node": "^18.17.3",
"@typescript-eslint/eslint-plugin": "^5.62.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/plugin-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Fix [#211](https://github.com/vitejs/vite-plugin-react/issues/211): Add `@types/babel__cores` to dependencies

## 4.0.4 (2023-07-31)

- Fix [#198](https://github.com/vitejs/vite-plugin-react/discussions/198): Enable Babel if presets list is not empty
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@babel/core": "^7.22.9",
"@babel/plugin-transform-react-jsx-self": "^7.22.5",
"@babel/plugin-transform-react-jsx-source": "^7.22.5",
"@types/babel__core": "^7.20.1",
"react-refresh": "^0.14.0"
},
"peerDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions packages/plugin-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
hooks.forEach((hook) => hook(babelOptions, context, config))
}
} else if (typeof opts.babel !== 'function') {
// Because hooks and the callback option can mutate the Babel options
// we only create static option in this case and re-create them
// each time otherwise
staticBabelOptions = createBabelOptions(opts.babel)
}
},
Expand Down
38 changes: 10 additions & 28 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 8413a18

Please sign in to comment.