mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
build: install and configure Vite, move index.html
This commit is contained in:
parent
78dabe55ae
commit
6498ab79a4
7 changed files with 2271 additions and 11 deletions
|
|
@ -26,15 +26,16 @@
|
||||||
/>
|
/>
|
||||||
<script
|
<script
|
||||||
defer
|
defer
|
||||||
src="/main.js"
|
type="module"
|
||||||
|
src="/src/main.jsx"
|
||||||
></script>
|
></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
||||||
<script
|
<script
|
||||||
type="text/javascript"
|
type="module"
|
||||||
src="/main.js"
|
src="/src/main.jsx"
|
||||||
></script>
|
></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -2,9 +2,11 @@
|
||||||
"name": "chatgpt-clone",
|
"name": "chatgpt-clone",
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack",
|
"build": "vite build",
|
||||||
|
"dev": "vite",
|
||||||
|
"preview-prod": "vite preview",
|
||||||
"build-dev": "Webpack . --watch"
|
"build-dev": "Webpack . --watch"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ import { createRoot } from 'react-dom/client';
|
||||||
// import { store } from './src/store';
|
// import { store } from './src/store';
|
||||||
import { RecoilRoot } from 'recoil';
|
import { RecoilRoot } from 'recoil';
|
||||||
|
|
||||||
import { ThemeProvider } from './src/hooks/ThemeContext';
|
import { ThemeProvider } from './hooks/ThemeContext';
|
||||||
import App from './src/App';
|
import App from './App';
|
||||||
import './src/style.css';
|
import './style.css';
|
||||||
import './src/mobile.css';
|
import './mobile.css';
|
||||||
|
|
||||||
const container = document.getElementById('root');
|
const container = document.getElementById('root');
|
||||||
const root = createRoot(container);
|
const root = createRoot(container);
|
||||||
|
|
@ -1,9 +1,31 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"target": "ESNext",
|
||||||
|
"useDefineForClassFields": true,
|
||||||
|
"lib": [
|
||||||
|
"DOM",
|
||||||
|
"DOM.Iterable",
|
||||||
|
"ESNext"
|
||||||
|
],
|
||||||
|
"allowJs": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"strict": true,
|
||||||
|
"forceConsistentCasingInFileNames": false,
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "nodenext",
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"noImplicitAny": false,
|
||||||
|
"noEmit": false,
|
||||||
|
"jsx": "react-jsx",
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"jsx": "react",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"~/*": ["./src/*"]
|
"~/*": ["./src/*"]
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"include": [
|
||||||
|
"src"
|
||||||
|
],
|
||||||
}
|
}
|
||||||
40
client/vite.config.ts
Normal file
40
client/vite.config.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
import { defineConfig } from "vite";
|
||||||
|
import react from "@vitejs/plugin-react";
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
|
// https://vitejs.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
server: {
|
||||||
|
host: "localhost",
|
||||||
|
port: 3090,
|
||||||
|
strictPort: false,
|
||||||
|
proxy: {
|
||||||
|
"/api": {
|
||||||
|
target: "http://localhost:3080",
|
||||||
|
changeOrigin: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plugins: [react()],
|
||||||
|
build: {
|
||||||
|
sourcemap: true,
|
||||||
|
outDir: "./public",
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"~": path.join(__dirname, "src/"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
define: {
|
||||||
|
// global: {},
|
||||||
|
// process: {
|
||||||
|
// env: {
|
||||||
|
// VITE_APP_API: process?.env.VITE_APP_API || 'production',
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// module.exports = {
|
||||||
|
// plugins: [require("tailwindcss")],
|
||||||
|
// };
|
||||||
2188
package-lock.json
generated
Normal file
2188
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
7
package.json
Normal file
7
package.json
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"devDependencies": {
|
||||||
|
"@vitejs/plugin-react": "^3.1.0",
|
||||||
|
"vite": "^4.2.1",
|
||||||
|
"vite-plugin-html": "^3.2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue