title: Vuex mapState reference error when vuex.js is included via script tag
body: <p>I'm running some test code for Vue.js and include Vue.js, Vuex and the javascript files via script tags (because it is for testing purposes only I don't want to use a build tool).</p>
  
  <p>Most of the code runs correctly but the Vuex map functions (mapState, mapGetters ...) won't work. I always get <code>ReferenceError: Can't find variable: mapState</code>. Why can't I access the mapState? Aren't that global functions when included via script tag?</p>
  
  <p>Just an example using code from the vue docs:</p>
  
  <p>index.html</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /&gt;
  
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  
  
  &lt;body&gt;
  
      &lt;div id="app"&gt;&lt;/div&gt;
  
  
      &lt;!-- Libraries ---------- --&gt;
      &lt;script src="vendor/js/vue.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="vendor/js/vuex.js" type="text/javascript"&gt;&lt;/script&gt;
  
      &lt;script src="app/js/store.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="app/js/app.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>store.js</p>
  
  <pre><code>const state = {
      count: 0
  }
  
  
  const getters = {
      evenOrOdd: state =&gt; state.count % 2 === 0 ? 'even' : 'odd'
  }
  
  
  const mutations = {
      increment (state) {
          state.count++
      },
      decrement (state) {
          state.count--
      }
  }
  
  
  const actions = {
      increment: ({ commit }) =&gt; commit('increment'),
      decrement: ({ commit }) =&gt; commit('decrement'),
      incrementIfOdd: ({ commit, state }) =&gt; {
          if ((state.count + 1) % 2 === 0) {
              commit('increment')
          }
      },
      incrementAsync: ({ commit }) =&gt; {
          return new Promise((resolve, reject) =&gt; {
              setTimeout(() =&gt; {
                  commit('increment')
                  resolve()
              }, 1000)
          })
      }
  }
  
  
  const store = new Vuex.Store({
      state,
      getters,
      mutations,
      actions
  })
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>const app = new Vue({
      el: '#app',
      template: `
          &lt;main&gt;
              &lt;h1 class="title"&gt;Heading&lt;/h1&gt;
          &lt;/main&gt;
      `,
      store,
      computed: {
          ...mapState([count])
      }
  });
  </code></pre>