Skip to content

Commit

Permalink
fix: the include/exclude in webpack needs to correspond to the path f…
Browse files Browse the repository at this point in the history
…ormat of the system
  • Loading branch information
jeffwcx committed Sep 20, 2024
1 parent c1881a6 commit d922cb5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion suites/preset-vue/src/vue/webpack/config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import type Config from '@umijs/bundler-webpack/compiled/webpack-5-chain';
import type { IApi } from 'dumi';
import { babelPresetTypeScript } from 'dumi/tech-stack-utils';
import path from 'node:path';
import VueLoaderPlugin from 'vue-loader/dist/pluginWebpack5.js';

// Webpack configuration mainly refers to @umijs/preset-vue

export function getConfig(config: Config, api: IApi) {
const dumiSrc = api.paths.absSrcPath;
// The internal path in umi is in POSIX format,
// and include/exclude of webpack needs to be converted to the corresponding format for different systems.
const dumiSrc = path.resolve(api.paths.absSrcPath);
const babelInUmi = config.module.rule('src').use('babel-loader').entries();

// react jsx rules will only include the .dumi directory
Expand Down

0 comments on commit d922cb5

Please sign in to comment.