11import { ChildProcess , spawn } from "child_process" ;
22import chokidar from "chokidar" ;
3- import { copyFileSync } from "fs" ;
43import log from "loglevel" ;
54import { sep } from "path" ;
65import { sys } from "typescript" ;
76
8- import { dist , src } from "./constants" ;
9- import { getPackages , list } from "./utils" ;
7+ import { everythingScss , packagesRoot , src } from "./constants" ;
8+ import { combineAllFiles , getPackages , list } from "./utils" ;
109
1110/**
1211 * Creates a custom dev watcher for copying styles into dists correctly
@@ -28,7 +27,6 @@ export function watch(cjs: boolean): void {
2827 const name =
2928 packageName === "react-md" ? packageName : `@react-md/${ packageName } ` ;
3029 const { newLine } = sys ;
31- const dest = pathname . replace ( src , dist ) ;
3230
3331 let output = "" ;
3432 if ( sys . clearScreen ) {
@@ -41,12 +39,11 @@ export function watch(cjs: boolean): void {
4139 output = `[${ name } - ${ new Date ( ) . toLocaleTimeString ( ) } ] ` ;
4240 output += `Detected scss file change${ newLine } ` ;
4341 output += `${ pathname . replace ( prefix , "" ) } -> ` ;
44- output += `${ dest . replace ( prefix , "" ) } ` ;
42+ output += `${ everythingScss . replace ( packagesRoot , "" ) } ` ;
4543 output += newLine + newLine ;
4644 sys . write ( output ) ;
4745
48- // I don't care about the non-webpack imports for this
49- copyFileSync ( pathname , dest ) ;
46+ combineAllFiles ( ) ;
5047 } ) ;
5148 watcher . on ( "ready" , ( ) => {
5249 log . info ( "Started the watcher in the following packages:" ) ;
0 commit comments