mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-15 00:56:26 +08:00
chore(cli): build infra (#3375)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
import { build } from 'vite';
|
||||
|
||||
import { projectRoot } from '../config/index.js';
|
||||
|
||||
const infraFilePath = resolve(
|
||||
projectRoot,
|
||||
'packages',
|
||||
'infra',
|
||||
'vite.config.ts'
|
||||
);
|
||||
const pluginInfraFilePath = resolve(
|
||||
projectRoot,
|
||||
'packages',
|
||||
'plugin-infra',
|
||||
'vite.config.ts'
|
||||
);
|
||||
|
||||
export const buildInfra = async () => {
|
||||
await build({
|
||||
configFile: infraFilePath,
|
||||
});
|
||||
await build({
|
||||
configFile: pluginInfraFilePath,
|
||||
});
|
||||
};
|
||||
|
||||
export const watchInfra = async () => {
|
||||
await build({
|
||||
configFile: infraFilePath,
|
||||
build: {
|
||||
watch: {},
|
||||
},
|
||||
});
|
||||
await build({
|
||||
configFile: pluginInfraFilePath,
|
||||
build: {
|
||||
watch: {},
|
||||
},
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user