I need to create a global interface that can be accessed at runtime under a specific name.
/** Here is my code that will be injected */
// import Vue from "vue"; <- having two vue instances may cause issues
// ts-ignore <- Vue is only available at runtime
Vue.component();
/** This is vendor code that cannot be modified */
(function () {
const Vue = *VUE CODE*
{{ transpiled-code-gets-injected-here-at-runtime }}
})();
In this scenario, the Vue
variable is not accessible in any window or global context.