@chialab/esbuild-rna
Advanced tools
Comparing version 0.15.17 to 0.15.20
@@ -209,5 +209,15 @@ import path from 'path'; | ||
return `${pattern | ||
.replace('[name]', path.basename(inputFile, path.extname(inputFile))) | ||
.replace('[ext]', path.extname(inputFile)) | ||
.replace('[dir]', path.relative(outBase, path.dirname(filePath))) | ||
.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 || ''}`; | ||
} | ||
if (!match1 && match2) { | ||
return ''; | ||
} | ||
return match1 || ''; | ||
}) | ||
.replace('[dir]', () => path.relative(outBase, path.dirname(filePath))) | ||
.replace('[hash]', () => { | ||
@@ -214,0 +224,0 @@ const hash = crypto.createHash('sha1'); |
{ | ||
"name": "@chialab/esbuild-rna", | ||
"type": "module", | ||
"version": "0.15.17", | ||
"version": "0.15.20", | ||
"description": "A framework for esbuild plugins with transform and emit capabilities.", | ||
@@ -40,3 +40,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "2cf976d115889891248373ca6253d1e9eca79339" | ||
"gitHead": "9a2ea6a2189ccdc4b900d27e607378d56c774024" | ||
} |
37321
911