Philipp S.
Philipp S.

Reputation: 981

How to use isDev within a plugin?

How can I use isDev within my plugin?

Unfortunately I do not understand how to use it. Link to context documentation

This is what I tried:

/plugins/axios.js

export default function({ $axios, redirect, req }) {
  if (context.isDev) (
    console.log('Running as dev')
    ...

  ) 

How can I acces isDev?

Upvotes: 0

Views: 136

Answers (1)

Philipp S.
Philipp S.

Reputation: 981

Solved it.

export default function({ $axios, redirect, req, isDev }) {
  if (isDev) (
    console.log('Running as dev')
    ...
  ) 

Just add isDev to your parameters. (Because it is within the context)

Upvotes: 1

Related Questions