Skip to content

There is es6 related code in the template, and the polyfill is not automatically introduced after compilation #1773

Open
@zhouxinyong

Description

@zhouxinyong

Version

15.9.6

Reproduction link

https://github.com/zhouxinyong/vue2-build-issue

Steps to reproduce

  1. yarn
  2. add v-if="list.inclues(4)" in template at file: App.vue
  3. yarn build
  4. check the build file chunk-vendors.js

What is expected?

auto import polyfill with Array.prototype.includes

What is actually happening?

no polyfill with Array.prototype.includes


when i change v-if="list.inclues(4)" to v-if="checkKey(4)", and add a method like below

methods: {
  checkKey (key) {
    return this.list.includes(key)
  }
}

then run yarn build, check the build file chunk-vendors.js, there has auto import polyfill with Array.prototype.includes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions