Compare commits

..
4 Commits
Author SHA1 Message Date
手瓜一十雪 377c780d1a Comment out manual chunking for @heroui in Vite config
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
The manual chunking logic for '@heroui' modules in the Vite configuration has been commented out. This may be to simplify chunk splitting or address build issues related to custom chunking.
2025-12-24 19:31:52 +08:00
手瓜一十雪 aefa8985b1 Remove vite-plugin-font and related dependencies
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
This update removes vite-plugin-font and its associated dependencies from pnpm-lock.yaml. This likely reflects a cleanup of unused packages or a migration away from font-related build tooling.
2025-12-24 18:30:55 +08:00
手瓜一十雪 b034940dfd Remove vite-plugin-font from dependencies
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
Deleted the vite-plugin-font package from both the root and frontend package.json files as it is no longer required.
2025-12-24 18:29:17 +08:00
手瓜一十雪 cb8e10cc7e Add sw_template.js to build and improve service worker loading
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
Updated the Vite config to copy sw_template.js to the static assets during build. Modified backend to load sw_template.js from the static directory if available, falling back to the source assets if not. This ensures the service worker template is correctly served in production builds.
2025-12-24 18:20:51 +08:00
6 changed files with 10 additions and 507 deletions

No files matched your search

-1
View File
@@ -29,7 +29,6 @@
"dependencies": {
"express": "^5.0.0",
"silk-wasm": "^3.6.1",
"vite-plugin-font": "^5.1.2",
"ws": "^8.18.3"
}
}
+1
View File
@@ -27,6 +27,7 @@ const ShellBaseConfigPlugin: PluginOption[] = [
targets: [
{ src: '../napcat-native/', dest: 'dist/native', flatten: false },
{ src: '../napcat-webui-frontend/dist/', dest: 'dist/static/', flatten: false },
{ src: '../napcat-webui-backend/src/assets/sw_template.js', dest: 'dist/static/' },
{ src: '../napcat-core/external/napcat.json', dest: 'dist/config/' },
{ src: '../../package.json', dest: 'dist' },
{ src: '../napcat-shell-loader', dest: 'dist' },
+5 -1
View File
@@ -200,7 +200,11 @@ export async function InitWebUi (logger: ILogWrapper, pathWrapper: NapCatPathWra
app.get('/webui/sw.js', async (_req, res) => {
try {
// 读取模板文件
const templatePath = resolve(__dirname, 'src/assets/sw_template.js');
let templatePath = resolve(__dirname, 'static', 'sw_template.js');
if (!existsSync(templatePath)) {
templatePath = resolve(__dirname, 'src', 'assets', 'sw_template.js');
}
let swContent = readFileSync(templatePath, 'utf-8');
// 替换版本号
@@ -117,7 +117,6 @@
"typescript": "^5.7.3",
"vite": "^6.0.5",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-font": "^5.1.2",
"vite-plugin-image-optimizer": "^2.0.3",
"vite-plugin-static-copy": "^2.2.0",
"vite-tsconfig-paths": "^5.1.4"
@@ -13,7 +13,7 @@ export default defineConfig(({ mode }) => {
plugins: [
react(),
tsconfigPaths(),
ViteImageOptimizer({}),
ViteImageOptimizer({})
],
base: '/webui/',
server: {
@@ -40,9 +40,9 @@ export default defineConfig(({ mode }) => {
output: {
manualChunks (id) {
if (id.includes('node_modules')) {
if (id.includes('@heroui/')) {
return 'heroui';
}
// if (id.includes('@heroui/')) {
// return 'heroui';
// }
if (id.includes('react-dom')) {
return 'react-dom';
}
-500
View File
File diff suppressed because it is too large. Load diff