Initial commit: Falcon React v5.1.0 template

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-27 18:25:18 +08:00
commit 1cded9ded0
1348 changed files with 174347 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
import { defineConfig, loadEnv } from 'vite';
import fs from 'fs/promises';
import react from '@vitejs/plugin-react';
import jsconfigPaths from 'vite-jsconfig-paths';
import compileSCSS from './compile-scss';
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
return defineConfig({
plugins: [react(), jsconfigPaths(), compileSCSS()],
base: process.env.VITE_PUBLIC_URL || '/',
esbuild: {
loader: 'jsx',
include: /src\/.*\.jsx?$/,
exclude: []
},
optimizeDeps: {
esbuildOptions: {
plugins: [
{
name: 'load-js-files-as-jsx',
setup(build) {
build.onLoad({ filter: /src\/.*\.js$/ }, async args => ({
loader: 'jsx',
contents: await fs.readFile(args.path, 'utf8')
}));
}
}
]
}
},
define: {
global: 'window'
},
server: {
open: true,
port: Number(process.env.VITE_APP_PORT) || 3000,
host: process.env.VITE_APP_HOST || 'localhost'
}
});
};