[ci] yarn format

This commit is contained in:
matthewp 2022-01-13 18:29:57 +00:00 committed by GitHub Actions
parent 20eaddb2a7
commit b3150121d1
3 changed files with 12 additions and 14 deletions

View file

@ -8,10 +8,7 @@ describe('Static build - frameworks', () => {
before(async () => { before(async () => {
fixture = await loadFixture({ fixture = await loadFixture({
projectRoot: './fixtures/static-build-frameworks/', projectRoot: './fixtures/static-build-frameworks/',
renderers: [ renderers: ['@astrojs/renderer-preact', '@astrojs/renderer-react'],
'@astrojs/renderer-preact',
'@astrojs/renderer-react'
],
buildOptions: { buildOptions: {
experimentalStaticBuild: true, experimentalStaticBuild: true,
}, },

View file

@ -8,10 +8,15 @@ export default {
default: { default: jsx }, default: { default: jsx },
} = await import('@babel/plugin-transform-react-jsx'); } = await import('@babel/plugin-transform-react-jsx');
return { return {
plugins: [jsx({}, { plugins: [
runtime: 'automatic', jsx(
importSource: '@astrojs/renderer-react' {},
})], {
runtime: 'automatic',
importSource: '@astrojs/renderer-react',
}
),
],
}; };
}, },
viteConfig() { viteConfig() {

View file

@ -2,11 +2,7 @@
// it can run in Node ESM. 'react' doesn't declare this module as an export map // it can run in Node ESM. 'react' doesn't declare this module as an export map
// So we have to use the .js. The .js is not added via the babel automatic JSX transform // So we have to use the .js. The .js is not added via the babel automatic JSX transform
// hence this module as a workaround. // hence this module as a workaround.
import jsxr from 'react/jsx-runtime.js'; import jsxr from 'react/jsx-runtime.js';
const { jsx, jsxs, Fragment } = jsxr; const { jsx, jsxs, Fragment } = jsxr;
export { export { jsx, jsxs, Fragment };
jsx,
jsxs,
Fragment
};