We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c7dea2 commit 09e7eb1Copy full SHA for 09e7eb1
packages/plugin-vue-jsx/index.js
@@ -95,10 +95,13 @@ function vueJsxPlugin(options = {}) {
95
} = options
96
97
const filter = createFilter(include || /\.[jt]sx$/, exclude)
98
+ const [filepath] = id.split('?')
99
- if (filter(id)) {
100
+ // use id for script blocks in Vue SFCs (e.g. `App.vue?vue&type=script&lang.jsx`)
101
+ // use filepath for plain jsx files (e.g. App.jsx)
102
+ if (filter(id) || filter(filepath)) {
103
const plugins = [importMeta, [jsx, babelPluginOptions], ...babelPlugins]
- if (id.endsWith('.tsx')) {
104
+ if (id.endsWith('.tsx') || filepath.endsWith('.tsx')) {
105
plugins.push([
106
require('@babel/plugin-transform-typescript'),
107
// @ts-ignore
0 commit comments