Skip to content

Commit 2e7a87a

Browse files
committed
chore(dev-utils): Update watch command for new sass modules
1 parent 3521e9b commit 2e7a87a

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

packages/dev-utils/src/watch.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { ChildProcess, spawn } from "child_process";
22
import chokidar from "chokidar";
3-
import { copyFileSync } from "fs";
43
import log from "loglevel";
54
import { sep } from "path";
65
import { 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

Comments
 (0)