Skip to content

Commit

Permalink
feat(typescript): support lang="tsx" in vue files
Browse files Browse the repository at this point in the history
close #1219
  • Loading branch information
yyx990803 committed May 3, 2018
1 parent 3dd38da commit 718ba3c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/@vue/cli-plugin-typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ module.exports = (api, {
options.loaders = options.loaders || {}
options.loaders.ts = options.loaders.ts || []
options.loaders.ts.push(loader)
options.loaders.tsx = options.loaders.tsx || []
if (loader.loader === 'ts-loader') {
// for TSX need to append tsx suffix
options.loaders.tsx.push({
loader: 'ts-loader',
options: {
transpileOnly: true,
appendTsxSuffixTo: [/\.vue$/],
happyPackMode: useThreads
}
})
} else {
options.loaders.tsx.push(loader)
}
return options
})
}
Expand Down

0 comments on commit 718ba3c

Please sign in to comment.