mirror of
https://github.com/withastro/astro.git
synced 2025-01-13 22:11:20 -05:00
26 lines
697 B
JavaScript
26 lines
697 B
JavaScript
|
export default {
|
||
|
name: '@astrojs/renderer-solid',
|
||
|
client: './client',
|
||
|
server: './server',
|
||
|
knownEntrypoints: ['solid-js', 'solid-js/web'],
|
||
|
external: ['solid-js/web/dist/server.js', 'solid-js/dist/server.js', 'babel-preset-solid'],
|
||
|
jsxImportSource: 'solid-js',
|
||
|
jsxTransformOptions: async ({ isSSR }) => {
|
||
|
const [{ default: solid }] = await Promise.all([import('babel-preset-solid')]);
|
||
|
const options = {
|
||
|
presets: [
|
||
|
solid({}, { generate: isSSR ? 'ssr' : 'dom' }),
|
||
|
]
|
||
|
}
|
||
|
|
||
|
if (isSSR) {
|
||
|
options.alias = {
|
||
|
'solid-js/web': 'solid-js/web/dist/server.js',
|
||
|
'solid-js': 'solid-js/dist/server.js',
|
||
|
};
|
||
|
}
|
||
|
|
||
|
return options;
|
||
|
}
|
||
|
};
|