How about we let the kid learn how to program (which will outlive your favorite bundler and file hierarchy anyway) first? It's a 100 line script, one of the mistakes I made learning how to program was trying to be like the adults and focusing on minutiae like code organization rather than good code.
EDIT: story time. I once tried to make a 2D game engine in my late teens, but I wanted to be like the adults and have a proper class hierarchy. Suffice to say, I never finished it. Come to find a few years later, now class oriented OOP is passé and I was wrong to waste that time on it.
Learning to code and get things working is more cool (and in the end, more profitable) than making your code fit the norms of the day, which won't last anyway.
My intent is less "code structure", and more "most of the pieces you need to make a Node project also work in the browser". Imports/exports and Parcel would get liamilan most of the way towards being able to do...
if (window) {
document.write(...)
} else {
console.log(..)
}
...and have it just work, without having to write everything twice.
EDIT: story time. I once tried to make a 2D game engine in my late teens, but I wanted to be like the adults and have a proper class hierarchy. Suffice to say, I never finished it. Come to find a few years later, now class oriented OOP is passé and I was wrong to waste that time on it.
Learning to code and get things working is more cool (and in the end, more profitable) than making your code fit the norms of the day, which won't last anyway.