Browser-addon/utils/plugins/copy-content-style.ts
2023-04-01 01:54:44 +02:00

22 lines
584 B
TypeScript

import * as fs from 'fs';
import * as path from 'path';
import colorLog from '../log';
import { PluginOption } from 'vite';
const { resolve } = path;
const root = resolve(__dirname, '..', '..');
const contentStyle = resolve(root, 'src', 'pages', 'content', 'style.css');
const outDir = resolve(__dirname, '..', '..', 'public');
export default function copyContentStyle(): PluginOption {
return {
name: 'make-manifest',
buildEnd() {
fs.copyFileSync(contentStyle, resolve(outDir, 'contentStyle.css'));
colorLog('contentStyle copied', 'success');
},
};
}