replace __VERSION__ with a string definition

This commit is contained in:
Sebastian 2022-09-05 11:06:50 -03:00
parent e0e33a88db
commit d7a55a165f
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1
3 changed files with 8 additions and 4 deletions

View File

@ -30,7 +30,7 @@ export default {
external: builtins,
plugins: [
replace({
__VERSION__: printedVersion,
__VERSION__: `"${printedVersion}"`,
}),
nodeResolve({

View File

@ -160,8 +160,9 @@ function applyVerbose(verbose: boolean): void {
// TODO
}
declare const __VERSION__: string;
function printVersion(): void {
console.log("__VERSION__");
console.log(__VERSION__);
process.exit(0);
}

View File

@ -33,8 +33,11 @@ const nodeEntryPoint = {
sourcemaps(),
replace({
'__VERSION__': `"${pkg.version}"`,
'__GIT_HASH__': `"${GIT_HASH}"`,
values: {
'__VERSION__': `"${pkg.version}"`,
'__GIT_HASH__': `"${GIT_HASH}"`,
},
preventAssignment: false,
}),
commonjs({