Webpack ProvidePlugin alternative

Hey!

Migrating my project from webpack to esbuild.

With webpack I had a class exported "globally" like this



environment.plugins.append('Provide', new webpack.ProvidePlugin({
  ApplicationController: ['application_controller', 'default'] // app/javascript/application_controller.js
})) 

then I could inherit from this base class without the import:

//app/javascript/controllers/hello_controller.js
export default class extends ApplicationController {
 ...
}

Since I'm just starting with esbuild, is there a way to accomplish this with esbuild?