Skip to content

Commit

Permalink
fix: define json transform error
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Jan 9, 2024
1 parent 0e68811 commit 3b23dd2
Show file tree
Hide file tree
Showing 6 changed files with 1,092 additions and 100 deletions.
2 changes: 2 additions & 0 deletions playground/spa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
"@babel/preset-react": "^7.23.3",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"@vitejs/plugin-legacy": "^5.2.0",
"@vitejs/plugin-react": "^4.1.0",
"cross-env": "^7.0.3",
"terser": "^5.26.0",
"typescript": "^5.2.2",
"vite": "^4.4.11",
"vite-plugin-public-typescript": "workspace:*"
Expand Down
2 changes: 2 additions & 0 deletions playground/spa/public-typescript/env.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
window['VITE_ENV'] = import.meta.env
window['PROCESS_ENV'] = process.env
window['PROCESS_ENV_NODE_ENV'] = process.env.NODE_ENV
2 changes: 2 additions & 0 deletions playground/spa/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import legacy from '@vitejs/plugin-legacy'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { injectScripts, publicTypescript } from 'vite-plugin-public-typescript'
Expand Down Expand Up @@ -38,6 +39,7 @@ export default defineConfig(() => ({
injectTo: 'head-prepend',
},
]),
legacy(),
],
clearScreen: false,
}))
Loading

0 comments on commit 3b23dd2

Please sign in to comment.