Skip to content

Commit

Permalink
fix broken module require (broken while adding require stl)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrgdavor committed Jan 29, 2024
1 parent dbf70e0 commit 5825edf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/require/src/require.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export const require = (urlOrSource, transform, readFile, base, root, importData

const resolved = resolveUrl(aliasedUrl, base, root, moduleBase)
const resolvedStr = resolved.url.toString()
const isJs = resolvedStr.endsWith('.ts') || resolvedStr.endsWith('.js')
const arr = resolvedStr.split('/')
// no file ext is usually module from CDN
const isJs = !arr[arr.length-1].includes('.') || resolvedStr.endsWith('.ts') || resolvedStr.endsWith('.js')
if(!isJs && importData){
const info = extractPathInfo(resolvedStr)
let content = readFile(resolvedStr,{output: importData.isBinaryExt(info.ext)})
Expand Down

0 comments on commit 5825edf

Please sign in to comment.