Skip to content

Commit

Permalink
fix: vue jsx import isssue
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwcx committed Jun 14, 2024
1 parent 69c741d commit 6399cfd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion suites/preset-vue/src/vue/webpack/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ export function getConfig(config: Config, api: IApi) {
const babelInUmi = config.module.rule('src').use('babel-loader').entries();

// react jsx rules will only include the .dumi directory
config.module.rule('jsx-ts-tsx').include.add(dumiSrc).end();
config.module
.rule('jsx-ts-tsx')
.include.add(dumiSrc)
.add(/node_modules/)
.end();

// Vue3 tsx support
config.module
.rule('vue-jsx-tsx')
.test(/\.(jsx|ts|tsx)$/)
.exclude.add(dumiSrc)
.add(/node_modules/) // limitation: vue jsx/tsx cannot be imported directly from node_modules
.end()
.use('babel-loader')
.loader(babelInUmi.loader)
Expand Down

0 comments on commit 6399cfd

Please sign in to comment.