Browse Source

fix(admin-ui): Add polling to watch mode to alleviate race condition

When in watch mode with UI extensions, the `ng serve` watch mode will start to re-compile as soon as the first UI extension file is copied. When there are a lot of files to copy, this leads to race conditions where the app cannot be compiled because now all the UI extension files have been copied over yet.
Michael Bromley 6 years ago
parent
commit
1b95a81e76
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/admin-ui/src/devkit/watch.ts

+ 1 - 1
packages/admin-ui/src/devkit/watch.ts

@@ -31,7 +31,7 @@ export function watchAdminUiApp(extensions: Array<Required<AdminUiExtension>>, p
     createExtensionsModules(extensions);
 
     const config = isInVendureMonorepo() ? 'plugin-dev' : 'plugin';
-    const buildProcess = spawn('yarn', ['ng', 'serve', `-c=${config}`, `--port=${port}`], {
+    const buildProcess = spawn('yarn', ['ng', 'serve', `-c=${config}`, `--port=${port}`, `--poll=1000`], {
         cwd,
         shell: true,
         stdio: 'inherit',