diff --git a/suites/preset-vue/src/vue/webpack/config.ts b/suites/preset-vue/src/vue/webpack/config.ts index e8c563e06..520c0a967 100644 --- a/suites/preset-vue/src/vue/webpack/config.ts +++ b/suites/preset-vue/src/vue/webpack/config.ts @@ -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)