Files
UT-Registration-Plus/utils/plugins/make-manifest.ts
Dhruv b17c3fae6d fix: cleanup imports (#112)
* fix: use path alias

* fix: more path alias

* fix: even more path aliasing

* fix: even moreeeee path aliasing

* fix: sort imports

* fix: sort imports (again)
2024-03-06 15:11:29 -06:00

28 lines
723 B
TypeScript

import * as fs from 'fs';
import * as path from 'path';
import type { PluginOption } from 'vite';
import manifest from '../../src/manifest';
import colorLog from '../log';
const { resolve } = path;
const outDir = resolve(__dirname, '..', '..', 'public');
export default function makeManifest(): PluginOption {
return {
name: 'make-manifest',
buildEnd() {
if (!fs.existsSync(outDir)) {
fs.mkdirSync(outDir);
}
const manifestPath = resolve(outDir, 'manifest.json');
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
colorLog(`Manifest file copy complete: ${manifestPath}`, 'success');
},
};
}