diff options
Diffstat (limited to 'app/assets/javascripts/packages_and_registries/dependency_proxy/index.js')
-rw-r--r-- | app/assets/javascripts/packages_and_registries/dependency_proxy/index.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/assets/javascripts/packages_and_registries/dependency_proxy/index.js b/app/assets/javascripts/packages_and_registries/dependency_proxy/index.js new file mode 100644 index 00000000000..dc73470e07d --- /dev/null +++ b/app/assets/javascripts/packages_and_registries/dependency_proxy/index.js @@ -0,0 +1,26 @@ +import Vue from 'vue'; +import { parseBoolean } from '~/lib/utils/common_utils'; +import app from '~/packages_and_registries/dependency_proxy/app.vue'; +import { apolloProvider } from '~/packages_and_registries/dependency_proxy/graphql'; +import Translate from '~/vue_shared/translate'; + +Vue.use(Translate); + +export const initDependencyProxyApp = () => { + const el = document.getElementById('js-dependency-proxy'); + if (!el) { + return null; + } + const { dependencyProxyAvailable, ...dataset } = el.dataset; + return new Vue({ + el, + apolloProvider, + provide: { + dependencyProxyAvailable: parseBoolean(dependencyProxyAvailable), + ...dataset, + }, + render(createElement) { + return createElement(app); + }, + }); +}; |