Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use globalName instead of window.$nuxt in the plugin #345

jjelev opened this issue Mar 19, 2020 — with CMTY · 1 comment · Fixed by titonobre/ or titonobre/


Copy link

jjelev commented Mar 19, 2020

What problem does this feature solve?

Nuxt global is leaking in the final build of application. However many modules reference this directly instead of refering to global name from configuration.

Can we use the globalName option in the nuxt config instead of $nuxt directly ?

const $loading = () => (window.$nuxt && window.$nuxt.$loading && window.$nuxt.$loading.set) ? window.$nuxt.$loading : noopLoading

What does the proposed changes look like?

const $loading = () => (window.<%= options.globalName %> && window.<%= options.globalName %>.$loading && window.<%= options.globalName %>.$loading.set) ? window.<%= options.globalName %>$loading : noopLoading
This feature request is available on Nuxt community (#c347)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
2 participants