fix: adapt frontend for legacy Chrome and runtime config
This commit is contained in:
1 parent
db2f21191c
commit
388a9133fc
84 files changed
+1186
-528
No files matched your search
@@ -5,10 +5,22 @@ import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from "vite";
|
||||
import sourceIdentifierPlugin from "vite-plugin-source-identifier";
|
||||
|
||||
const rootDir = fileURLToPath(new URL(".", import.meta.url));
|
||||
const rootDir = fileURLToPath(new URL(".", import.meta.url));
|
||||
// Tailwind 4 emits CSS cascade layers, which require Chrome 99+. Chrome 100
|
||||
// is therefore the practical lower bound for this Win7 legacy build.
|
||||
const LEGACY_CHROME = 100 << 16;
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [sourceIdentifierPlugin(), react()],
|
||||
export default defineConfig({
|
||||
plugins: [sourceIdentifierPlugin(), react()],
|
||||
css: {
|
||||
// Also used by the production CSS minifier. Development CSS is handled
|
||||
// by the matching PostCSS compatibility pass in postcss.config.js.
|
||||
lightningcss: {
|
||||
targets: {
|
||||
chrome: LEGACY_CHROME,
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: [
|
||||
{
|
||||
@@ -33,7 +45,11 @@ export default defineConfig({
|
||||
},
|
||||
],
|
||||
},
|
||||
"base":"./",
|
||||
"base":"./",
|
||||
build: {
|
||||
cssMinify: "lightningcss",
|
||||
target: "chrome100",
|
||||
},
|
||||
server: {
|
||||
// 与 scripts/env.sh FRONTEND_PORT=5174、圆桌 wujie 嵌入文档一致。
|
||||
port: 5173,
|
||||
|
||||
Reference in new issue
Block a user