title: How to store Firebase background messages to vuex store in vuejs?
body: <p>I'm new to Firebase cloud messaging(FCM).
  I used web version 9 (modular) FCM in my Vuejs v2 project.
  I put firebase-messaging-sw.js file on root of my project.<br />
  firebase-messaging-sw.js:</p>
  <pre><code>importScripts('https://www.gstatic.com/firebasejs/9.0.1/firebase-app-compat.js');
  importScripts('https://www.gstatic.com/firebasejs/9.0.1/firebase-messaging-compat.js');
  
  var firebaseConfig = {
      ...
  };
  
  firebase.initializeApp(firebaseConfig);
  const messaging = firebase.messaging();
  
  messaging.onBackgroundMessage(function(payload) {
      //Save payload to vuex store
  });
  </code></pre>
  <p>When i want to import store from store package(<code>import {store} from './store/store'</code>), an error raised:<br />
  <code>Uncaught SyntaxError: Cannot use import statement outside a module</code><br />
  How can i store FCM messages to vuex store?</p>