Home > Software design >  Vuex: Why disable strict mode?
Vuex: Why disable strict mode?

Time:05-12

I don't see any cons to using strict mode with this vuex. The performances seem better and it is easier to debug. So, why disable that mode?

CodePudding user response:

Strict mode should not be used in production. Strict mode runs a synchronous deep watcher on the state tree for detecting inappropriate mutations, and this can slow down the application. To avoid changing strict to false each time you want to create a production bundle, you should use a build tool that makes the strict value false when creating the production bundle

you can enable that mode with this:

const store = new Vuex.Store({  // ...  strict: true});
  • Related