File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class TransSFCServe extends Command
1313
1414 public function handle (): int
1515 {
16- $ nodeScriptPath = base_path ('vendor/iammarjamal/transsfc/src/Watcher/index.js ' );
16+ $ nodeScriptPath = base_path ('vendor/iammarjamal/transsfc/src/Watcher/index.mjs ' );
1717
1818 if (!file_exists ($ nodeScriptPath )) {
1919 $ this ->error ("Node.js script not found at: {$ nodeScriptPath }" );
@@ -43,4 +43,4 @@ public function handle(): int
4343 $ this ->info ('✅ Script ran successfully ' );
4444 return self ::SUCCESS ;
4545 }
46- }
46+ }
Original file line number Diff line number Diff line change 11// Import required modules.
2- const chokidar = require ( "chokidar" ) ; // Module for watching file changes.
3- const fs = require ( "fs-extra" ) ; // Module for file system operations.
4- const path = require ( "path" ) ; // Module for handling file paths.
5- const crypto = require ( "crypto" ) ; // Module for generating file hashes.
2+ import chokidar from "chokidar" ; // Module for watching file changes.
3+ import fs from "fs-extra" ; // Module for file system operations.
4+ import path from "path" ; // Module for handling file paths.
5+ import crypto from "crypto" ; // Module for generating file hashes.
6+
7+ // Get the absolute path of the Laravel project
8+ const laravelProjectPath = process . cwd ( ) ; // Correct Laravel project root
69
710// Define paths for Blade views and translation files.
8- const viewsPath = path . join ( __dirname , "../../../ resources/views" ) ;
9- const langPath = path . join ( __dirname , "../../../ lang" ) ;
11+ const viewsPath = path . join ( laravelProjectPath , "resources/views" ) ;
12+ const langPath = path . join ( laravelProjectPath , "lang" ) ;
1013
1114console . log (
1215 "🔍 Starting async watch on Blade files for translation updates..."
@@ -407,4 +410,4 @@ chokidar
407410 removeTranslationsForFile ( filePath ) ;
408411 } ) ;
409412
410- console . log ( "Async Lang watcher is running..." ) ;
413+ console . log ( "Async Lang watcher is running..." ) ;
You can’t perform that action at this time.
0 commit comments