Skip to content

modern build is not modern #3474

Closed
Closed
@jacekkarczmarczyk

Description

@jacekkarczmarczyk

Version

3.4.0

Reproduction link

https://github.com/jacekkarczmarczyk/vue-modern-issue

main.ts:

import App from './App.vue';
App.mounted();

App.vue:

<script>
export default {
  mounted: async () => await Promise.resolve(),
};
</script>

Environment info

  System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz
  Binaries:
    Node: 8.11.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.13.0 - C:\Users\Jacek\AppData\Roaming\npm\yarn.CMD
    npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 42.17134.1.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.2
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.2
    @vue/babel-preset-app:  3.4.0
    @vue/babel-preset-jsx:  1.0.0-beta.2
    @vue/babel-sugar-functional-vue:  1.0.0-beta.2
    @vue/babel-sugar-inject-h:  1.0.0-beta.2
    @vue/babel-sugar-v-model:  1.0.0-beta.2
    @vue/babel-sugar-v-on:  1.0.0-beta.2
    @vue/cli-overlay:  3.4.0
    @vue/cli-plugin-babel: ^3.2.0 => 3.4.0
    @vue/cli-plugin-eslint: ^3.2.0 => 3.4.0
    @vue/cli-plugin-typescript: ^3.2.0 => 3.4.0
    @vue/cli-plugin-unit-jest: ^3.2.0 => 3.4.0
    @vue/cli-service: ^3.2.0 => 3.4.0
    @vue/cli-shared-utils:  3.4.0
    @vue/component-compiler-utils:  2.5.2
    @vue/eslint-config-standard: ^4.0.0 => 4.0.0
    @vue/eslint-config-typescript: ^3.2.0 => 3.2.1
    @vue/preload-webpack-plugin:  1.1.0
    @vue/test-utils: ^1.0.0-beta.20 => 1.0.0-beta.29
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^5.0.0 => 5.2.2
    jest-serializer-vue:  2.0.2
    typescript: ^3.3.3 => 3.3.3
    vue-eslint-parser:  5.0.0
    vue-hot-reload-api:  2.3.2
    vue-jest:  3.0.3
    vue-loader:  15.6.3
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.5.21 => 2.6.6
    vue-template-es2015-compiler:  1.8.2
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

yarn && yarn build

What is expected?

modern build should not include polyfill, it should containt the async and await keywords

What is actually happening?

legacy and modern dist files have the same size and content, modern build includes polyfill


Changing main.ts to

const App = {
  mounted: async () => await Promise.resolve(),
};
App.mounted();

produces the correct modern build:

https://github.com/jacekkarczmarczyk/vue-modern-issue/tree/correct-build/dist/js

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