2021-05-26 18:30:22 +00:00
|
|
|
export default {
|
2021-12-22 21:11:05 +00:00
|
|
|
name: '@astrojs/renderer-react',
|
|
|
|
client: './client.js',
|
|
|
|
server: './server.js',
|
|
|
|
jsxImportSource: 'react',
|
|
|
|
jsxTransformOptions: async () => {
|
|
|
|
const {
|
|
|
|
default: { default: jsx },
|
|
|
|
} = await import('@babel/plugin-transform-react-jsx');
|
|
|
|
return {
|
2022-01-13 18:29:57 +00:00
|
|
|
plugins: [
|
|
|
|
jsx(
|
|
|
|
{},
|
|
|
|
{
|
|
|
|
runtime: 'automatic',
|
|
|
|
importSource: '@astrojs/renderer-react',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
],
|
2021-12-22 21:11:05 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
viteConfig() {
|
|
|
|
return {
|
|
|
|
optimizeDeps: {
|
2022-04-02 20:15:41 +00:00
|
|
|
include: [
|
|
|
|
'@astrojs/renderer-react/client.js',
|
|
|
|
'react',
|
|
|
|
'react/jsx-runtime',
|
|
|
|
'react/jsx-dev-runtime',
|
|
|
|
'react-dom',
|
|
|
|
],
|
2021-12-22 21:11:05 +00:00
|
|
|
exclude: ['@astrojs/renderer-react/server.js'],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
dedupe: ['react', 'react-dom'],
|
|
|
|
},
|
|
|
|
ssr: {
|
|
|
|
external: ['react-dom/server.js'],
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
2021-05-26 18:31:27 +00:00
|
|
|
};
|