Files
MaaAssistantArknights/website/bundler.mjs
Alisa c2bd0133ba refactor: 合并 MAA Website 仓库 (#8886)
* chore: migrate maa website

* ci: change docs build test to website build test

* fix: rename artifact name to dist

* ci: add workflow to deploy website to azure
2024-04-24 09:31:52 +08:00

27 lines
614 B
JavaScript

import * as fs from 'fs';
const bundleBasePath = './dist';
const maaProjectLocationMapping = [
{
from: './apps/web/dist',
to: `${bundleBasePath}`,
},
{
from: '../docs/.vuepress/dist',
to: `${bundleBasePath}/docs`,
},
];
console.log(`remove ${bundleBasePath}`);
fs.rmSync(bundleBasePath, { recursive: true, force: true });
maaProjectLocationMapping.forEach(({ from, to }) => {
if (fs.existsSync(from) === false) {
console.error(`[ERR] ${from} does not exist`);
process.exit(-1);
}
console.log(`[INF] copy ${from} to ${to}`);
fs.cpSync(from, to, { recursive: true });
});