Skip to content

Commit

Permalink
fix(ui5): adjust libs mapping to compensate for REserve2 strict check…
Browse files Browse the repository at this point in the history
…ing (#99)

- Also add debug traces for mappings
  • Loading branch information
ArnaudBuchholz committed Aug 31, 2024
1 parent f6d9ba9 commit a4651e5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/ui5.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,24 @@ module.exports = {
}]

job.libs.forEach(({ relative, source }) => {
if (source.endsWith('/') || source.endsWith('\\')) {
source = source.substring(0, source.length - 1)
}
mappings.unshift({
match: new RegExp(`\\/resources\\/${relative.replace(/\//g, '\\/')}(.*)`),
cwd: source,
file: '$1',
static: !job.watch && !job.debugDevMode
}, {
match: new RegExp(`\\/resources\\/${relative.replace(/\//g, '\\/')}(.*)`),
status: 404
custom: async (request, response, $1) => {
if ($1 === undefined) {
getOutput(job).debug('libs', `Unable to map ${relative} : $1 is undefined`)
} else {
getOutput(job).debug('libs', `Unable to map ${relative}/${$1} to ${join(source, $1)}`)
}
return 404
}
})
})

Expand Down

0 comments on commit a4651e5

Please sign in to comment.