title: CASL is not working properly in Vue Production Mode
body: <p>I have defined some rules for specific roles, they all are working fine. But when I build vue project in production mode, all the rules gives false. Details are here below:</p>
  
  <p>I have this file <code>ability.js</code>, which is giving me rules:</p>
  
  <pre><code>export const getRules = (role, userId) =&gt; {
       const { can, cannot, rules } = AbilityBuilder.extract()
       switch(role) {
            case 'TENANT_ADMIN':
                     can('manage', 'all')
                     break
            case 'TENANT_AGENT': 
                     can('view', 'ConversationView')
                     break
            case 'TENANT_AGENT_LIMITED': 
                     can('view', 'ConversationView', { userId: userId })
                     break
       }
       return rules
  }
  </code></pre>
  
  <p>I'm updating rules like this in App.vue (all values are valid)</p>
  
  <pre><code>this.$ability.update(getRules(role, userId))
  </code></pre>
  
  <p>I'm checking permissions using below code.</p>
  
  <pre><code>class ConversationView {
      constructor(props) {
          Object.assign(this, props)
      }
  }
  
  this.$can('view', new ConversationView({ userId: Id }))
  </code></pre>
  
  <p>Now, when I run this code in local/development mode. It is working fine (giving me true where it needs to), but when I generate a production build it is not working as expected (always gives me false)</p>
  
  <p>Development Build Command:</p>
  
  <pre><code>vue-cli-service build --mode local --modern
  </code></pre>
  
  <p>Development Build .env.local</p>
  
  <pre><code>VUE_APP_STAGE=development
  NODE_ENV=development
  </code></pre>
  
  <p>Production Build Command:</p>
  
  <pre><code>vue-cli-service build --mode prod --modern
  </code></pre>
  
  <p>Production Build .env.prod</p>
  
  <pre><code>VUE_APP_STAGE=production
  NODE_ENV=production
  </code></pre>
  
  <p>Let me know why this is happening.</p>
  
  <p><strong>Replicated the steps here.</strong></p>
  
  <p>Follow below link to view running and expected version:
  <a href="https://codesandbox.io/embed/github/s4h1u1b9h9a2m/vue-casl-example/tree/master/" rel="nofollow noreferrer">LINK 01</a>
  Output:</p>
  
  <pre><code>Checking for '1' =&gt; true 
  Checking for 1 =&gt; false 
  Checking for '2' =&gt; false
  </code></pre>
  
  <p>Clone the same project in your local, or download it from [github <a href="https://github.com/s4h1u1b9h9a2m/vue-casl-example" rel="nofollow noreferrer">2</a>
  After running, we're getting this output:</p>
  
  <pre><code>Checking for '1' =&gt; false 
  Checking for 1 =&gt; false 
  Checking for '2' =&gt; false
  </code></pre>