// @ts-check

/**
 * Styles and scripts are instead watched by webpack in the `assets.js` task
 */
module.exports = function watch() {
  const gulp = require("gulp");
  const { favicons } = require("./favicons");
  const svgicons = require("./svgicons");
  const i18n = require("./i18n");
  const { clear } = require("./clean");
  const paths = require("../paths");
  const { getWatchPath } = require("../utils");
  const { join, frontend } = paths;
  const { src } = frontend;

  // TODO: maybe  we could trigger a reload through wds?
  gulp.watch(getWatchPath(join(src.favicons, "favicon.png")), favicons);
  gulp.watch(getWatchPath(join(src.svgicons, "*.svg")), svgicons);
  gulp.watch(getWatchPath(join(src.translations, "*.csv")), i18n);
  // clear caches when the env changes
  gulp.watch(getWatchPath(paths.env), clear);
};
