mirror of
https://github.com/withastro/astro.git
synced 2025-01-13 22:11:20 -05:00
Remove custom optimizeDeps.include in react integration (#12923)
This commit is contained in:
parent
cca3bc934c
commit
c7642fb80b
5 changed files with 14 additions and 11 deletions
5
.changeset/curvy-pans-share.md
Normal file
5
.changeset/curvy-pans-share.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/solid-js': patch
|
||||
---
|
||||
|
||||
Adds the client entrypoint to `optimizeDeps.include`
|
5
.changeset/smart-ties-hear.md
Normal file
5
.changeset/smart-ties-hear.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/react': patch
|
||||
---
|
||||
|
||||
Removes react-specific entrypoints in `optimizeDeps.include` and rely on `@vitejs/plugin-react` to add
|
|
@ -54,20 +54,10 @@ function getViteConfiguration(
|
|||
) {
|
||||
return {
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
reactConfig.client,
|
||||
'react',
|
||||
'react/jsx-runtime',
|
||||
'react/jsx-dev-runtime',
|
||||
'react-dom',
|
||||
'react-compiler-runtime',
|
||||
],
|
||||
include: [reactConfig.client],
|
||||
exclude: [reactConfig.server],
|
||||
},
|
||||
plugins: [react({ include, exclude, babel }), optionsPlugin(!!experimentalReactChildren)],
|
||||
resolve: {
|
||||
dedupe: ['react', 'react-dom', 'react-dom/server'],
|
||||
},
|
||||
ssr: {
|
||||
external: reactConfig.externals,
|
||||
noExternal: [
|
||||
|
|
|
@ -51,6 +51,7 @@ function getViteConfiguration(
|
|||
) {
|
||||
const config: UserConfig = {
|
||||
optimizeDeps: {
|
||||
include: ['@astrojs/solid-js/client.js'],
|
||||
exclude: ['@astrojs/solid-js/server.js'],
|
||||
},
|
||||
plugins: [solid({ include, exclude, ssr: true })],
|
||||
|
|
|
@ -116,6 +116,8 @@ async function getViteConfiguration(
|
|||
|
||||
const config: UserConfig = {
|
||||
optimizeDeps: {
|
||||
// We add `vue` here as `@vitejs/plugin-vue` doesn't add it and we want to prevent
|
||||
// re-optimization if the `vue` import is only encountered later.
|
||||
include: ['@astrojs/vue/client.js', 'vue'],
|
||||
exclude: ['@astrojs/vue/server.js', VIRTUAL_MODULE_ID],
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue