/** 在dist中添加html */

const fs = require('fs')
const rimraf = require('rimraf')
const file = './dist/index.html'

const html = `
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <link rel="icon" href="./favicon.ico" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>组件列表</title>
  <script type="module" crossorigin src="./component-lib.web.js"></script>
</head>

<body>
  <div id="app"></div>

</body>

</html>
`
rimraf(file, (err) => {
  if (err) return console.error(err)
  fs.writeFile(file, html, 'utf-8', (err) => {
    if (err) return console.error(err)
  })
  })
