src/sketch.js
import 'p5'
import './styles.css'
function setup() {
createCanvas(windowWidth, windowHeight)
textSize(20)
}
function draw() {
background(240)
text('Hello, p5.js ' + VERSION, 20, 40)
circle(mouseX, mouseY, 60)
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight)
}
// p5 looks for these on window; ES modules keep them private, so hand them over.
Object.assign(window, { setup, draw, windowResized })