Skip to content

Commit dd259c2

Browse files
committed
fix: do not use fork-ts-checker-webpack-plugin for vue-next
As the `fork-ts-checker-webpack-plugin` tries to load the compiler, it does not play well at the moment with the vue-next compiler `@vue/compiler-sfc`. This disables the plugin if we are building a vue-next project.
1 parent 38a7b0f commit dd259c2

File tree

1 file changed

+9
-1
lines changed
  • packages/@vue/cli-plugin-typescript

1 file changed

+9
-1
lines changed

packages/@vue/cli-plugin-typescript/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,17 @@ module.exports = (api, projectOptions) => {
7676
return options
7777
})
7878

79-
if (!process.env.VUE_CLI_TEST) {
79+
let isUsingNextCompiler = true
80+
try {
81+
require('@vue/compiler-sfc')
82+
} catch (e) {
83+
isUsingNextCompiler = false
84+
}
85+
if (!process.env.VUE_CLI_TEST && !isUsingNextCompiler) {
8086
// this plugin does not play well with jest + cypress setup (tsPluginE2e.spec.js) somehow
8187
// so temporarily disabled for vue-cli tests
88+
// it also does not play well with `@vue/compiler-sfc`
89+
// so we also disable it if the project is built with Vue 3
8290
config
8391
.plugin('fork-ts-checker')
8492
.use(require('fork-ts-checker-webpack-plugin'), [{

0 commit comments

Comments
 (0)