text: import Vue from 'vue';
  import Vuex from 'vuex';
  
  import createPersistedState from "vuex-persistedstate";
  import SecureLS from "secure-ls";
  
  const ls = new SecureLS({ isCompression: false });
  
  Vue.use(Vuex)
  
  const state = {
    sidebarShow: 'responsive',
    sidebarMinimize: false,
    token: false
  }
  
  const mutations = {
    toggleSidebarDesktop(state) {
      const sidebarOpened = [true, 'responsive'].includes(state.sidebarShow)
      state.sidebarShow = sidebarOpened ? false : 'responsive'
    },
    toggleSidebarMobile(state) {
      const sidebarClosed = [false, 'responsive'].includes(state.sidebarShow)
      state.sidebarShow = sidebarClosed ? true : 'responsive'
    },
    set(state, [variable, value]) {
      state[variable] = value
    },
  }
  
  const modulesFiles = require.context('./modules', true, /\.js$/)
  const modules = modulesFiles.keys().reduce((modules, modulePath) => {
    const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
    const value = modulesFiles(modulePath)
    modules[moduleName] = value.default
    console.log(modules)
    return modules
  }, {})
  
  export default new Vuex.Store({
    state,
    plugins: [
      createPersistedState({
        storage: {
          getItem: key => ls.get(key),
          setItem: (key, value) => ls.set(key, value),
          removeItem: key => ls.remove(key),
        }
      })
    ],
    mutations,
    modules
  })