Change React template from Vite to create-react-app.

This commit is contained in:
James Murdza 2024-07-31 17:09:24 -07:00
parent 2e68b0b537
commit a74f7bf71a
2 changed files with 32 additions and 32 deletions

View File

@ -158,7 +158,7 @@ io.on("connection", async (socket) => {
console.log("Created container ", data.sandboxId);
io.emit(
"previewURL",
"https://" + containers[data.sandboxId].getHostname(5173)
"https://" + containers[data.sandboxId].getHostname(3000)
);
}
} catch (e: any) {

View File

@ -21,49 +21,49 @@ const startercode = {
{
name: "package.json",
body: `{
"name": "react",
"name": "react-app",
"version": "0.1.0",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-scripts": "5.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"vite": "^5.2.0"
"eslint-plugin-react-hooks": "^4.6.0"
}
}`,
},
{
name: "vite.config.js",
body: `import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
host: "0.0.0.0",
}
})
`,
},
{
name: "index.html",
name: "public/index.html",
body: `<!doctype html>
<html lang="en">
<head>
@ -133,7 +133,7 @@ export default App
`,
},
{
name: "src/main.jsx",
name: "src/index.js",
body: `import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'