unplugin / unplugin-vue2-script-setup

💡 Bring `<script setup>` to Vue 2.
MIT License
602 stars 39 forks source link

Setup script cannot work with `ForkTsCheckerWebpackPlugin` #18

Closed sxzz closed 3 years ago

sxzz commented 3 years ago

reproduce repo: https://github.com/sxzz/vue2-script-setup-issue

Issues checking in progress...
ERROR in src/main.ts:3:8
TS1192: Module '"/Users/kevin/projects/vue2-lab/src/App.vue"' has no default export.
    1 | import Vue from "vue";
    2 | import VueCompositionAPI from "@vue/composition-api";
  > 3 | import App from "./App.vue";
      |        ^^^
    4 |
    5 | Vue.config.productionTip = false;
    6 |
sxzz commented 3 years ago

For now, I just disable ForkTsCheckerWebpackPlugin for vue

args[0].typescript.extensions.vue.enabled = false;

https://github.com/sxzz/vue2-script-setup-issue/blob/09f4f98df2e5d99670937059a1d588a04fe867e7/vue.config.js#L15

vue-template-compiler seems unable to handle with script setup. https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#typescript-extensions-options

antfu commented 3 years ago

Yes, see the TypeScript section of Vue CLI.