Update Dockerfile, docker-compose, and package.json; add versioning script and styles for version display
Fix #21
This commit is contained in:
17
build.js
Normal file
17
build.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Generate version number with timestamp
|
||||
const version = new Date().toISOString().replace(/[-:.]/g, '').slice(0, 15);
|
||||
|
||||
// Read the HTML file
|
||||
const indexPath = path.join(__dirname, 'public', 'index.html');
|
||||
let indexHtml = fs.readFileSync(indexPath, 'utf8');
|
||||
|
||||
// Replace the version placeholder with the generated version number
|
||||
indexHtml = indexHtml.replace(/<!-- VERSION_PLACEHOLDER -->/g, `Version: ${version}`);
|
||||
|
||||
// Write the updated HTML back to the file
|
||||
fs.writeFileSync(indexPath, indexHtml);
|
||||
|
||||
console.log(`Version number updated to: ${version}`);
|
||||
Reference in New Issue
Block a user