nuxt-community / legacy-modules

MIT License
1.28k stars 158 forks source link

Update index.js #408

Closed IgnisDa closed 3 years ago

IgnisDa commented 3 years ago

This change will allow users to disable this module via environment variables like so:

modules: [
    ['@nuxtjs/localtunnel', { disabled: process.env.DISABLE_LOCALTUNNEL === 1 }],
]
danielroe commented 3 years ago

@IgnisDa This is an issue that users will face for any module (see this comment). Could I suggest instead:

modules: [
  process.env.DISABLE_LOCALTUNNEL !== 1 && '@nuxtjs/localtunnel',
].filter(Boolean)
IgnisDa commented 3 years ago

Yes, this is a nice solution. Closing issue.