Skip to content

Commit cad0c49

Browse files
committed
fix: fix JS error when webpack recompiles Pattern Lab
1 parent 7c03f5c commit cad0c49

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/build-tools/tasks/pattern-lab-tasks.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@ compileWithNoExit.displayName = 'pattern-lab:compile';
9797

9898
async function watch() {
9999
config = config || await getConfig();
100+
const dirs = await manifest.getAllDirs();
101+
100102
// Used by watches
101103
const debouncedCompile = debounce(compileWithNoExit, config.debounceRate);
102104

103105
const globPattern = `**/*.{${config.watchedExtensions.join(',')}}`;
104106
const watchedFiles = [
105-
...manifest.getAllDirs(process.cwd()).map(dir => path.join(dir, globPattern)),
107+
dirs.map(dir => path.join(dir, globPattern)),
106108
path.join(plSource, globPattern),
107109
path.join(config.dataDir, '*.*'),
108110
];

0 commit comments

Comments
 (0)