Skip to content

Commit

Permalink
fix: workaround for resolve esm package in code block demo (#2082)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinbao1001 committed Apr 26, 2024
1 parent 6d1d053 commit 62662ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/features/compile/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export default (api: IApi) => {
api.chainWebpack(async (memo) => {
const babelInUmi = memo.module.rule('src').use('babel-loader').entries();
const loaderPath = require.resolve('../../loaders/markdown');

// support require mjs packages(eg. element-plus/es)
memo.resolve.merge({
conditionNames: ['...', 'import'],
});

const loaderBaseOpts: Partial<IMdLoaderOptions> = {
techStacks,
cwd: api.cwd,
Expand Down

0 comments on commit 62662ea

Please sign in to comment.