[ci] format

This commit is contained in:
delucis 2022-06-29 15:48:55 +00:00 committed by fredkbot
parent e3fdc9b403
commit e667477103

View file

@ -32,14 +32,17 @@ function getCompatRenderer(): AstroRenderer {
return { return {
plugins: [ plugins: [
jsx({}, { runtime: 'automatic', importSource: 'preact/compat' }), jsx({}, { runtime: 'automatic', importSource: 'preact/compat' }),
['babel-plugin-module-resolver', { [
'babel-plugin-module-resolver',
{
alias: { alias: {
'react': 'preact/compat', react: 'preact/compat',
'react-dom/test-utils': 'preact/test-utils', 'react-dom/test-utils': 'preact/test-utils',
'react-dom': 'preact/compat', 'react-dom': 'preact/compat',
'react/jsx-runtime': 'preact/jsx-runtime' 'react/jsx-runtime': 'preact/jsx-runtime',
} },
}], },
],
], ],
}; };
}, },
@ -66,20 +69,20 @@ function getViteConfiguration(compat?: boolean): ViteUserConfig {
viteConfig.optimizeDeps!.include!.push( viteConfig.optimizeDeps!.include!.push(
'preact/compat', 'preact/compat',
'preact/test-utils', 'preact/test-utils',
'preact/compat/jsx-runtime', 'preact/compat/jsx-runtime'
); );
viteConfig.resolve = { viteConfig.resolve = {
alias: [ alias: [
{ find: 'react', replacement: 'preact/compat' }, { find: 'react', replacement: 'preact/compat' },
{ find: 'react-dom/test-utils', replacement: 'preact/test-utils' }, { find: 'react-dom/test-utils', replacement: 'preact/test-utils' },
{ find: 'react-dom', replacement: 'preact/compat' }, { find: 'react-dom', replacement: 'preact/compat' },
{ find: 'react/jsx-runtime', replacement: 'preact/jsx-runtime' } { find: 'react/jsx-runtime', replacement: 'preact/jsx-runtime' },
], ],
dedupe: ['preact/compat'], dedupe: ['preact/compat'],
}; };
} }
return viteConfig return viteConfig;
} }
export default function ({ compat }: { compat?: boolean } = {}): AstroIntegration { export default function ({ compat }: { compat?: boolean } = {}): AstroIntegration {