diff --git a/playground/.env b/playground/.env index bbd825d..a0e03df 100644 --- a/playground/.env +++ b/playground/.env @@ -1,2 +1,2 @@ -VITE_ESM_CDN=https://esm.sh/ +VITE_ESM_CDN=https://esm.run/ VITE_CSS_CDN=https://cdn.jsdelivr.net/npm/ diff --git a/playground/react/index.js b/playground/react/index.js new file mode 100644 index 0000000..0eaa7a3 --- /dev/null +++ b/playground/react/index.js @@ -0,0 +1,2 @@ +export * from 'https://cdn.jsdelivr.net/npm/react@17.0.2/+esm' +export { default } from 'https://cdn.jsdelivr.net/npm/react@17.0.2/+esm' diff --git a/playground/react/jsx-runtime.js b/playground/react/jsx-runtime.js new file mode 100644 index 0000000..376bc96 --- /dev/null +++ b/playground/react/jsx-runtime.js @@ -0,0 +1,2 @@ +export * from 'https://cdn.jsdelivr.net/npm/react@17.0.2/jsx-runtime/+esm' +export { default } from 'https://cdn.jsdelivr.net/npm/react@17.0.2/jsx-runtime/+esm' diff --git a/playground/vite.config.ts b/playground/vite.config.ts index 1b71da3..1db59e9 100644 --- a/playground/vite.config.ts +++ b/playground/vite.config.ts @@ -1,6 +1,7 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import { config } from 'dotenv' +import * as path from 'path' config() const esmCDN = process.env.VITE_ESM_CDN @@ -17,7 +18,7 @@ export default defineConfig(({ command }) => ({ ], resolve: { alias: { - react: `${esmCDN}react`, + react: path.resolve(__dirname, './react'), 'react-dom': `${esmCDN}react-dom`, sucrase: 'sucrase/dist/index.js', },