Skip to content
⚠️You are viewing an older version. Switch to the latest version (v11.x).View latest →

Vite plugin ​

This library has a Vite plugin that can improve DX when using it.

Installation ​

bash
npm install mobx-view-model-vite-plugin
bash
pnpm add mobx-view-model-vite-plugin
bash
yarn add mobx-view-model-vite-plugin

Usage ​

Open your vite.config.ts and add this plugin.

ts
import { mobxViewModel } from "mobx-view-model-vite-plugin";
...
  plugins: [
    mobxViewModel({
      reloadOnChangeViewModel: true
    })
  ]
...

Features ​

reloadOnChangeViewModel ​

This option reloads the page after your ViewModel changes.