Skip to content

Commit

Permalink
docs(vision): add note on dev-only usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Aug 15, 2022
1 parent 6bafbdb commit 3f990af
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/@sanity/vision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,27 @@ export default createConfig({
],
})
```

### Only enabling it for development

If you only want the tool available in development (eg not in deployed studios), you can import and use the `isDev` constant from the `sanity` package:

```ts
// `sanity.config.ts` / `sanity.config.js`:
import {createConfig, isDev} from 'sanity'
import {vision} from '@sanity/vision'

const devOnlyPlugins = [vision()]

export default createConfig({
// ...
plugins: [
// ... your other plugins here ...
...(isDev ? devOnlyPlugins : []),
],
})
```

## License

MIT-licensed. See LICENSE.

0 comments on commit 3f990af

Please sign in to comment.