refactor: update version handling and remove placeholder injection

- Simplified version display in context menu and template by directly importing version from package.json.
- Removed static version and environment methods from Artplayer class, replacing them with dynamic imports.
- Eliminated placeholder injection logic from build and dev scripts, streamlining the build process.
- Cleaned up build and dev scripts for better readability and maintainability.
This commit is contained in:
Harvey Zack committed 2025-06-20 11:04:29 +08:00
1 parent e2e8e83e63
commit e8a7e050c4
16 files changed
+233 -287

No files matched your search

-13
View File
@@ -28,16 +28,3 @@ export function removeDir(dir) {
fs.rmdirSync(dir);
}
}
export function injectPlaceholders(filePath, placeholders) {
const original = fs.readFileSync(filePath, 'utf-8');
let modified = original;
for (const [key, value] of Object.entries(placeholders)) {
const pattern = new RegExp(key, 'g');
modified = modified.replace(pattern, value);
}
fs.writeFileSync(filePath, modified);
return () => fs.writeFileSync(filePath, original); // 构建完还原
}