import { readFileSync } from 'fs' ; import { resolve } from 'path' ; import { writeFile , insertGlobalImports } from '../utils/index' ; const ArtTemplate = require ( 'art-template' ) ; export default function generateEntry ( ) { const indexTpl = readFileSync ( resolve ( __dirname , './tplFiles/entry.tpl' ) , 'utf-8' ) ; writeFile ( { path : resolve ( process . cwd ( ) , './.viter/entry.tsx' ) , content : ArtTemplate . render ( indexTpl , { imports : insertGlobalImports ( resolve ( process . cwd ( ) , './src' ) ) } ) } ) ; }