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 authored and PeachScript committed Apr 26, 2024
1 parent 8b1a512 commit 5cde38b
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: ['require', 'node', 'import'],
});

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

0 comments on commit 5cde38b

Please sign in to comment.