Skip to content

Commit

Permalink
fix: do not use fork-ts-checker-webpack-plugin for vue-next
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cexbrayat committed Feb 9, 2020
1 parent 38a7b0f commit dd259c2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/@vue/cli-plugin-typescript/index.js
Expand Up @@ -76,9 +76,17 @@ module.exports = (api, projectOptions) => {
return options
})

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

0 comments on commit dd259c2

Please sign in to comment.