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>
22 lines
524 B
TypeScript
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;
|
|
}
|
|
}
|
|
};
|
|
}
|