Cédric Rup
Cédric Rup

Reputation: 15938

Change client side configuration after nuxt build

I’d like to know if it’s possible to change client side configuration AFTER nuxt build happened. Scenario would be : build once, deploy on multiple envs with some configuration varations.

I’m well aware that you can affect some parameters with environnement variables (like API_URL), but it doesn’t seem to affect client side execution.

Example:

Thanks for your help ! Cédric

Upvotes: 1

Views: 829

Answers (1)

Aldarund
Aldarund

Reputation: 17621

You can use nuxt-env module https://github.com/samtgarson/nuxt-env

export default {
  computed: {
    testValue () { return this.$env.TEST_VALUE }
  }
}

Upvotes: 2

Related Questions