chore: React + Vite + Tailwind CSS 脚手架
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
b3be6f5f03
commit
8fa85966e0
+2
-2
@@ -5,8 +5,8 @@
|
||||
"scripts": {
|
||||
"start": "electron .",
|
||||
"dev": "concurrently \"npm run dev:renderer\" \"wait-on http://localhost:5173 && electron .\"",
|
||||
"dev:renderer": "vite --config renderer/vite.config.js",
|
||||
"build": "vite build --config renderer/vite.config.js && electron-builder",
|
||||
"dev:renderer": "vite --config renderer/vite.config.mjs",
|
||||
"build": "vite build --config renderer/vite.config.mjs && electron-builder",
|
||||
"test": "cd /Users/mikivl/workspace/excel-batch-editor && python3 -m pytest tests/python/ -v"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Excel 批量编辑器</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,19 @@
|
||||
import React from "react";
|
||||
import { MemoryRouter, Routes, Route, Navigate } from "react-router-dom";
|
||||
import TemplateList from "./pages/TemplateList";
|
||||
import TemplateConfig from "./pages/TemplateConfig";
|
||||
import Generate from "./pages/Generate";
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<MemoryRouter>
|
||||
<Routes>
|
||||
<Route path="/" element={<Navigate to="/templates" replace />} />
|
||||
<Route path="/templates" element={<TemplateList />} />
|
||||
<Route path="/templates/new" element={<TemplateConfig />} />
|
||||
<Route path="/templates/:id/edit" element={<TemplateConfig />} />
|
||||
<Route path="/generate" element={<Generate />} />
|
||||
</Routes>
|
||||
</MemoryRouter>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
@import "tailwindcss";
|
||||
@@ -0,0 +1,6 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import App from "./App";
|
||||
import "./index.css";
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root")).render(<App />);
|
||||
@@ -0,0 +1 @@
|
||||
export default function Generate() { return <div>Generate</div>; }
|
||||
@@ -0,0 +1 @@
|
||||
export default function TemplateConfig() { return <div>TemplateConfig</div>; }
|
||||
@@ -0,0 +1 @@
|
||||
export default function TemplateList() { return <div>TemplateList</div>; }
|
||||
@@ -0,0 +1,14 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react(), tailwindcss()],
|
||||
build: {
|
||||
outDir: "dist",
|
||||
emptyOutDir: true,
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user