function createFile ({ targetFile, ext, reference }) {
  const assetRelativePath = relative(appPaths.appDir, targetFile)

  if (fs.existsSync(targetFile)) {
    warn(`${ assetRelativePath } already exists.`, 'SKIPPED')
    console.log()
    return
  }

  fse.ensureDir(dirname(targetFile))
  const templatePath = join('templates/app', format, `${ type }.${ ext }`)

  fse.copy(
    appPaths.resolve.cli(templatePath),
    targetFile,
    err => {
      if (err) {
        console.warn(err)
        warn(`Could not generate ${ assetRelativePath }.`, 'FAIL')
        return
      }

      log(`Generated ${ type }: ${ assetRelativePath }`)
      if (reference) {
        log(`Make sure to reference it in ${ reference }`)
      }
      log()
    }
  )
}
@type {'page'|'layout'|'component'|'store'|'boot'|'ssrmiddleware'}