Skip to content

Commit

Permalink
fix(helper): 修复 esbuild resolve 静态资源问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode committed May 29, 2023
1 parent e3b632a commit 2a5b4c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/taro-helper/src/esbuild/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { pick } from 'lodash'
import { resolve } from 'path'

import type { OnResolveArgs, OnResolveResult } from 'esbuild'

export function externalEsbuildModule (args: Partial<OnResolveArgs>): OnResolveResult {
if (args.namespace === 'file' && args.importer && args.path) {
args.path = resolve(args.importer, args.path)
}
return {
...pick(args, [
'path',
Expand Down

0 comments on commit 2a5b4c0

Please sign in to comment.