// scripts/prepare-tests.ts
import fs from 'fs'
import path from 'path'
const DIST_TYPES = ['bundled', 'standalone', 'auto', 'esm', 'demo'] as const
function createHTML(type: (typeof DIST_TYPES)[number], minified: boolean = false) {
if (type === 'demo' && minified) return
let template = fs.readFileSync('index.html', 'utf8')
// Remove the existing script tags
template = template
.replace('', '')
.replace('', '')
.replace('', '')
.replace('', '')
const css_file_name = `example${minified ? '.min' : ''}.css`
const css_url = type !== 'demo' ? `/${css_file_name}` : `${css_file_name}`
const css_link = ``
template = template.replace('', `${css_link}\n`)
// Generate script tags based on format and minified state
let scripts = ''
const jsExt = minified ? '.min.js' : '.js'
switch (type) {
case 'bundled':
scripts = `
`
break
case 'demo':
scripts = `
`
break
case 'standalone':
scripts = `
`
break
case 'auto':
scripts = `
`
break
case 'esm':
scripts = `
`
break
}
template = template.replace('