async compileIfKotlinFilesChanged()

in packages/kotlin-webpack-plugin/plugin.js [109:136]


  async compileIfKotlinFilesChanged(compilation, done) {
    const changedFiles = Array.from(compilation.fileTimestamps.keys()).filter(
      (watchfile) =>
        (this.prevTimestamps.get(watchfile) || this.startTime) <
        (compilation.fileTimestamps.get(watchfile) || Infinity)
    );

    this.prevTimestamps = compilation.fileTimestamps;

    if (!changedFiles.some((it) => /\.kt$/.test(it))) {
      done();
      return;
    }

    this.log.info(
      `Compiling Kotlin sources because the following files were changed: ${changedFiles.join(
        ', '
      )}`
    );

    try {
      await this.compileKotlinSources();
    } catch (e) {
      compilation.errors.push(e);
    } finally {
      done();
    }
  }