function remark() {
  return src('.', { since: lastRun(remark) })
    .pipe(
      gulpRemark({
        quiet: true,
        frail: true
      })
    )
    .pipe(dest('.'));
}
/*.scss', {
    base: 'assets'
  })
    .pipe(sourcemaps.init())
    .pipe(sass().on('error', sass.logError))
    .pipe(
      postcss([
        fontMagician({
          foundries: ['custom', 'hosted'],
          // note if you modify this then you will have to
          // also modify the font awesome fonts in css folder
          // <https://caniuse.com/#feat=woff2>
          formats: 'woff ttf',
          hosted: [path.join(__dirname, config.buildBase, 'fonts'), '../fonts'],
          display: 'swap'
        }),
        postcssPresetEnv({ browsers: 'extends @ladjs/browserslist-config' }),
        ...(PROD ? [cssnano({ autoprefixer: false })] : []),
        reporter()
      ])
    );

  stream = stream.pipe(sourcemaps.write('./')).pipe(dest(config.buildBase));

  if (DEV) stream = stream.pipe(lr(config.livereload));

  return stream;
}

function xo() {
  return src('.', { since: lastRun(xo) })
    .pipe(gulpXo({ quiet: true, fix: true }))
    .pipe(gulpXo.format())
    .pipe(gulpXo.failAfterError());
}

// TODO: in the future use merge-streams and return a stream w/o through2
async function bundle() {
  const since = lastRun(bundle);
  const polyfillPath = path.join(config.buildBase, 'js', 'polyfill.js');
  const factorBundlePath = path.join(
    config.buildBase,
    'js',
    'factor-bundle.js'
  );

  await makeDir(path.join(config.buildBase, 'js'));

  async function getFactorBundle() {
    const paths = await globby('*