Files
ONE-OS/axhub-make/vite-plugins/addAxhubMarker.ts
王冕 a27e3b8e43 feat: sync full workspace including web modules, docs, and configurations to Gitea
Optimized the root .gitignore to exclude virtual environments, node modules,
and temp folders to ensure clean and lightweight version tracking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 18:12:25 +08:00

22 lines
524 B
TypeScript

import type { Plugin } from 'vite';
/**
* 添加本项目标识
* 在文件开头添加特殊标识,让第三方平台识别这是通过本项目打包的组件
*/
export function addAxhubMarker(): Plugin {
return {
name: 'add-axhub-marker',
enforce: 'post',
generateBundle(options, bundle) {
for (const chunk of Object.values(bundle)) {
if (chunk.type !== 'chunk') continue;
const marker = `/* @axhub-factory */\n`;
chunk.code = marker + chunk.code;
}
}
};
}