Getting hugo/esbuild to import vue.esm-bundler.js instead of vue.runtime.esm-bundler.js for 'vue'

Problem: When I have import { createApp } from 'vue'; in my assets/my.js, it builds okay but fails at runtime with this console warning:

Component provided template option but runtime compilation is not supported in this build of Vue. 
Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".

My Vue has some templates that need compiling at runtime, so I need the full Vue package contained in vue.esm-bundler.js (includes the compiler) but instead it seems to be loading vue.runtime.esm-bundler.js (excludes the compiler).

So, how do I configure my bundler to alias ‘vue’? Ideally, I would only be using hugo/esbuild as my bundler. I need to keep the build as simple as possible (for reasons). I’ve tried things like setting defines in the js.Build options but can’t get it to work. Is defines the right place, or should I be looking elsewhere?

UPDATE: I found THIS where bep says Hugo has a custom import resolver. So maybe I’ve been looking in the wrong place: esbuild docs, etc.

And I guess on the wrong forum.

You are on a gohugo.io forum. Not a Vue.js or js.Build one …

Thanks @divinerites, maybe I am. But since js.Build is part of Hugo (see LINK) and since my question is not specific to Vue, I thought I would ask here. The question would be the same if I needed Hugo’s custom import resolver to alias ‘foo’ to ‘foo.full-package.js’ instead of ‘foo.subset.js’.