Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix entry names config. #136

Merged
merged 9 commits into from
Mar 29, 2023
Prev Previous commit
Next Next commit
fix computeName in windows (again again)
edoardocavazza committed Mar 28, 2023
commit 39dce766fff759050e1b77b3ad5ec7a18b3e208e
22 changes: 11 additions & 11 deletions packages/esbuild-rna/lib/Build.js
Original file line number Diff line number Diff line change
@@ -827,20 +827,20 @@ export class Build {
return `${pattern
.replace('[name]', () => path.basename(inputFile, path.extname(inputFile)))
.replace('[ext]', () => path.extname(inputFile))
.replace(/(\/)?\[dir\](\/)?/, (fullMatch, match1, match2) => {
const dir = path.relative(outBase, path.dirname(filePath));
if (dir) {
return `${match1 || ''}${dir}${match2 || ''}`;
.replace('[hash]', () => this.hash(buffer))
.split(path.sep)
.map((part) => {
if (part === '[dir]') {
return path.relative(outBase, path.dirname(filePath)) || '';
}
if (!match1 && match2) {
return '';
return part;
})
.map((part) => {
if (part === '..') {
return '_.._';
}
return match1 || '';
return part;
})
.replace('[dir]', () => path.relative(outBase, path.dirname(filePath)))
.replace('[hash]', () => this.hash(buffer))
.split(path.sep)
.map((part) => (part === '..' ? '_.._' : part))
.filter((part) => part && part !== '.')
.join('/')
}${path.extname(inputFile)}`;