Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit cd1a438

Browse files
committed
Fix esbuild resolver
1 parent 56e4c53 commit cd1a438

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bundler/esbuild.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const cssPlugin: Plugin = {
1414
setup(build) {
1515
build.onResolve({ filter: /.*/ }, args => {
1616
const isRemote = util.isLikelyHttpURL(args.path)
17-
const path = isRemote ? args.path : util.trimPrefix(args.path, 'file://')
17+
const [path] = util.splitBy(isRemote ? args.path : util.trimPrefix(args.path, 'file://'), '#')
1818

1919
if (
2020
args.kind === 'url-token' ||
@@ -38,7 +38,7 @@ export const denoPlugin: Plugin = {
3838
setup(build) {
3939
build.onResolve({ filter: /.*/ }, args => {
4040
const isRemote = util.isLikelyHttpURL(args.path)
41-
const path = isRemote ? args.path : util.trimPrefix(args.path, 'file://')
41+
const [path] = util.splitBy(isRemote ? args.path : util.trimPrefix(args.path, 'file://'), '#')
4242

4343
if (
4444
args.kind === 'url-token' ||

0 commit comments

Comments
 (0)