Skip to content

Commit d3639ec

Browse files
committed
additional packaging updates required
1 parent 5883c1e commit d3639ec

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ RUN npm ci --silent
99
COPY . .
1010
RUN npm run build
1111

12-
# Make sure metadata files are included in the served 'dist' folder for the About Modal
13-
RUN cp package.json dist/ && \
14-
mkdir -p dist/release && \
15-
cp release/latest.json dist/release/
16-
1712
# Runtime stage: minimal image to serve the compiled app
1813
FROM node:20-alpine AS runtime
1914
WORKDIR /app

build-tauri.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ setlocal
2424
set WEBKIT_DISABLE_DMABUF_RENDERER=1
2525
set WEBKIT_DISABLE_COMPOSITING_MODE=1
2626
echo Building Tauri application for Windows...
27+
npm run build
2728
npm run tauri build
2829
endlocal
2930
echo Build finished.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"server": "vite --host --port 3024",
99
"setup-https": "./setup-https.sh",
1010
"setup-https-windows": "powershell -ExecutionPolicy Bypass -File ./setup-https.ps1",
11-
"build": "tsc && vite build",
11+
"build": "tsc && vite build && node scripts/copy-metadata.js",
12+
"postbuild": "node scripts/copy-metadata.js",
1213
"preview": "vite preview --port 3024",
1314
"test": "jest",
1415
"test:watch": "jest --watch",

scripts/copy-metadata.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import fs from 'fs';
2+
import path from 'path';
3+
4+
const distDir = path.join(process.cwd(), 'dist');
5+
const releaseDir = path.join(distDir, 'release');
6+
7+
// Ensure dist/release exists
8+
if (!fs.existsSync(releaseDir)) {
9+
fs.mkdirSync(releaseDir, { recursive: true });
10+
}
11+
12+
// Copy package.json
13+
fs.copyFileSync(
14+
path.join(process.cwd(), 'package.json'),
15+
path.join(distDir, 'package.json')
16+
);
17+
18+
// Copy release/latest.json
19+
if (fs.existsSync(path.join(process.cwd(), 'release', 'latest.json'))) {
20+
fs.copyFileSync(
21+
path.join(process.cwd(), 'release', 'latest.json'),
22+
path.join(distDir, 'release', 'latest.json')
23+
);
24+
}
25+
26+
console.log('Metadata copied to dist/');

0 commit comments

Comments
 (0)