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

NuxtJs: how to add a module to modules array in nuxt.config.js programtically? #103

Open
warlock1996 opened this issue Dec 8, 2021 · 0 comments

Comments

@warlock1996
Copy link

i am trying to add @nuxtjs/recaptcha module based on my env variable, i have a boolean variable in my publicRuntimeConfig block, i need to check this variable when nuxtjs boots up and add the @nuxtjs/recaptcha module if its true.

is there any way we can achive this ?

i am currently doing like this ..

// check if isCaptchaEnabled is true. // if true push it to the modules array. if (config.publicRuntimeConfig.isCaptchaEnabled) { config.modules.push('@nuxtjs/recaptcha') }

it is working but i think there is a better way of doing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant