Skip to content

Commit

Permalink
fix: sourcecode incorrect compilation (#2154)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinbao1001 authored Jun 28, 2024
1 parent 5f367b7 commit 55a48cf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/loaders/markdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,14 @@ export const demos = {
// skip un-existed source file, e.g. custom tech-stack return custom dependencies
// skip non-file asset because resolveMap will contains all dependencies since 2.3.0
if (asset.dependencies[file]?.type === 'FILE') {
let assetValue = `{{{require('-!${resolveMap[file]}?dumi-raw').default}}}`;
// mako not support -!
if (process.env.OKAM) {
assetValue = `{{{require('${resolveMap[file]}?dumi-raw').default}}}`;
}
// to avoid modify original asset object
asset = lodash.cloneDeep(asset);
asset.dependencies[
file
].value = `{{{require('${resolveMap[file]}?dumi-raw').default}}}`;
asset.dependencies[file].value = assetValue;
}
});

Expand Down

0 comments on commit 55a48cf

Please sign in to comment.