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

Closed
jjelev opened this issue Mar 19, 2020 · 1 comment · Fixed by titonobre/fanweekend.pt#17 or titonobre/fanweekend.pt#19

Comments

@jjelev
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 ?
https://github.com/nuxt-community/axios-module/blob/dev/lib/plugin.js#L129

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
Labels
None yet
Projects
None yet
2 participants