mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	
		
			
	
	
		
			18 lines
		
	
	
		
			469 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			18 lines
		
	
	
		
			469 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
|  | import chokidar from "chokidar"; | ||
|  | import fs from "fs"; | ||
|  | import path from "path"; | ||
|  | 
 | ||
|  | const emptyCallback = () => {}; | ||
|  | 
 | ||
|  | function onFileChanged(sourceFile: string) { | ||
|  |     const destFile = path.join("dist", sourceFile); | ||
|  |     console.log(`${sourceFile} -> ${destFile}`); | ||
|  |     fs.copyFile(sourceFile, destFile, emptyCallback); | ||
|  | } | ||
|  | 
 | ||
|  | const sourceDir = "src/public"; | ||
|  | 
 | ||
|  | chokidar | ||
|  |     .watch(sourceDir) | ||
|  |     .on("change", onFileChanged); | ||
|  | console.log(`Watching for changes to ${sourceDir}...`); |