@ -2,22 +2,16 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react' ;
import react from '@vitejs/plugin-react' ;
import { VitePWA } from 'vite-plugin-pwa' ;
import { VitePWA } from 'vite-plugin-pwa' ;
import path from 'node:path' ;
import path from 'node:path' ;
import { execSync } from 'node:child_process' ;
let hash = '' ;
let hash = '' ;
try {
try {
const process = new Deno . Command ( 'git' , {
hash = execSync ( 'git rev-parse --short HEAD' , { encoding : 'utf8' } ) . trim ( ) ;
args : [ 'rev-parse' , '--short' , 'HEAD' ] ,
stdout : 'piped'
} ) ;
const output = await process . output ( ) ;
hash = new TextDecoder ( ) . decode ( output . stdout ) . trim ( ) ;
} catch ( error ) {
} catch ( error ) {
console . error ( 'Error getting git hash:' , error ) ;
console . error ( 'Error getting git hash:' , error ) ;
hash = 'DEV' ;
hash = 'DEV' ;
}
}
console . log ( 'Commit hash:' , hash ) ;
export default defineConfig ( {
export default defineConfig ( {
plugins : [
plugins : [
react ( ) ,
react ( ) ,
@ -38,11 +32,12 @@ export default defineConfig({
} ,
} ,
resolve : {
resolve : {
alias : {
alias : {
'@app' : path . resolve ( Deno . cwd ( ) , './src' ) ,
// Using Node's path and process.cwd() instead of Deno.cwd()
'@pages' : path . resolve ( Deno . cwd ( ) , './src/pages' ) ,
'@app' : path . resolve ( process . cwd ( ) , './src' ) ,
'@components' : path . resolve ( Deno . cwd ( ) , './src/components' ) ,
'@pages' : path . resolve ( process . cwd ( ) , './src/pages' ) ,
'@core' : path . resolve ( Deno . cwd ( ) , './src/core' ) ,
'@components' : path . resolve ( process . cwd ( ) , './src/components' ) ,
'@layouts' : path . resolve ( Deno . cwd ( ) , './src/layouts' ) ,
'@core' : path . resolve ( process . cwd ( ) , './src/core' ) ,
'@layouts' : path . resolve ( process . cwd ( ) , './src/layouts' ) ,
} ,
} ,
} ,
} ,
server : {
server : {