src/main.js
import { setupCounter } from './modules/counter.js'
import './styles.css'
const button = document.querySelector('[data-counter]')
const output = document.querySelector('[data-count]')
if (!(button instanceof HTMLButtonElement) || !output) {
throw new Error('Counter elements were not found')
}
setupCounter(button, output)