Skip to content

Commit fc713f5

Browse files
committed
fix: update package json scripts commands
1 parent 81a1e0e commit fc713f5

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
"description": "Meshtastic web client",
66
"license": "GPL-3.0-only",
77
"scripts": {
8-
"build": "deno run -A npm:vite build",
8+
"build": "vite build",
99
"build:analyze": "BUNDLE_ANALYZE=true deno task build",
1010
"lint": "deno lint src/",
1111
"lint:fix": "deno lint --fix src/",
1212
"format": "deno fmt src/",
1313
"dev": "deno task dev:ui",
1414
"dev:ui": "deno run -A npm:vite dev",
1515
"dev:scan": "VITE_DEBUG_SCAN=true deno task dev:ui",
16-
"test": "deno run vitest",
16+
"test": "deno run -A npm:vitest",
1717
"test:ui": "deno task test --ui",
18-
"preview": "deno run --allow-net npm:vite preview",
19-
"package": "deno run -A npm:gzipper c -i html,js,css,png,ico,svg,webmanifest,txt dist dist/output && deno run -A --allow-run tar -cvf dist/build.tar -C ./dist/output/ ."
18+
"preview": "deno run -A npm:vite preview",
19+
"package": "gzipper c -i html,js,css,png,ico,svg,webmanifest,txt dist dist/output && tar -cvf dist/build.tar -C ./dist/output/ ."
2020
},
2121
"repository": {
2222
"type": "git",

vite.config.ts

+8-13
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@ import { defineConfig } from 'vite';
22
import react from '@vitejs/plugin-react';
33
import { VitePWA } from 'vite-plugin-pwa';
44
import path from 'node:path';
5+
import { execSync } from 'node:child_process';
56

67
let hash = '';
78
try {
8-
const process = new Deno.Command('git', {
9-
args: ['rev-parse', '--short', 'HEAD'],
10-
stdout: 'piped'
11-
});
12-
const output = await process.output();
13-
hash = new TextDecoder().decode(output.stdout).trim();
9+
hash = execSync('git rev-parse --short HEAD', { encoding: 'utf8' }).trim();
1410
} catch (error) {
1511
console.error('Error getting git hash:', error);
1612
hash = 'DEV';
1713
}
1814

19-
console.log('Commit hash:', hash);
20-
2115
export default defineConfig({
2216
plugins: [
2317
react(),
@@ -38,11 +32,12 @@ export default defineConfig({
3832
},
3933
resolve: {
4034
alias: {
41-
'@app': path.resolve(Deno.cwd(), './src'),
42-
'@pages': path.resolve(Deno.cwd(), './src/pages'),
43-
'@components': path.resolve(Deno.cwd(), './src/components'),
44-
'@core': path.resolve(Deno.cwd(), './src/core'),
45-
'@layouts': path.resolve(Deno.cwd(), './src/layouts'),
35+
// Using Node's path and process.cwd() instead of Deno.cwd()
36+
'@app': path.resolve(process.cwd(), './src'),
37+
'@pages': path.resolve(process.cwd(), './src/pages'),
38+
'@components': path.resolve(process.cwd(), './src/components'),
39+
'@core': path.resolve(process.cwd(), './src/core'),
40+
'@layouts': path.resolve(process.cwd(), './src/layouts'),
4641
},
4742
},
4843
server: {

0 commit comments

Comments
 (0)