build-system/tasks/extension-helpers.js
/**
 * Watches for non-JS changes within an extensions directory to trigger
 * recompilation.
 *
 * @param {string} extDir
 * @param {string} name
 * @param {string} version
 * @param {boolean} hasCss
 * @param {?Object} options
 * @return {Promise<void>}
 */
Watches for non-JS changes within an extensions directory to trigger
recompilation.


Watches for non - JS changes within an extensions directory to trigger recompilation .
async function watchExtension(extDir, name, version, hasCss, options) {
  function watchFunc() {
    buildExtension(name, version, hasCss, {
      ...options,
      continueOnError: true,
      isRebuild: true,
      watch: false,
    });
  }
  const cssDeps = `${extDir}/**/*.css`;
  const jisonDeps = `${extDir}/**/*.jison`;
  const ignored = /dist/; 
  watch([cssDeps, jisonDeps], {ignored}).on(
    'change',
    debounce(watchFunc, watchDebounceDelay)
  );
}
async function watchExtension ( extDir , name , version , hasCss , options ) { function watchFunc ( ) { buildExtension ( name , version , hasCss , { ... options , continueOnError : true , isRebuild : true , watch : false , } ) ; } const cssDeps = ` ${ extDir } ` ; const jisonDeps = ` ${ extDir } ` ; const ignored = / dist / ; watch ( [ cssDeps , jisonDeps ] , { ignored } ) . on ( 'change' , debounce ( watchFunc , watchDebounceDelay ) ) ; }
Watches for non-JS changes within an extensions directory to trigger
 recompilation.
Watches for non - JS changes within an extensions directory to trigger recompilation .
/**
   * Steps to run when a watched file is modified.
   */ //should not watch npm dist folders.