async watchKotlinSources()

in packages/kotlin-webpack-plugin/plugin.js [154:174]


  async watchKotlinSources(compilation, done) {
    const patterns = this.sources.map((it) => `${it}/**/*.kt`);
    const paths = await globby(patterns, {
      absolute: true,
    });

    const normalizedPaths = paths.map((it) => path.normalize(it));

    if (compilation.fileDependencies.add) {
      for (const path of normalizedPaths) {
        compilation.fileDependencies.add(path);
      }
    } else {
      // Before Webpack 4 - fileDepenencies was an array
      for (const path of normalizedPaths) {
        compilation.fileDependencies.push(path);
      }
    }

    done();
  }