1
0
mirror of synced 2026-03-23 02:58:34 +08:00

feat(runtime): 支持构建magic-admin的runtime产物

This commit is contained in:
roymondchen
2022-07-11 20:17:15 +08:00
committed by jia000
parent 7dc0b4e261
commit 014859fd2f
19 changed files with 34 additions and 19 deletions

View File

@@ -22,7 +22,7 @@ import { defineConfig, loadEnv } from 'vite';
import reactRefresh from '@vitejs/plugin-react-refresh';
export default defineConfig(({ command, mode }) => {
const { WATCH_INCLUDE = '' } = loadEnv(mode, process.cwd(), '');
const { WATCH_INCLUDE = '', BASE, OUT_DIR } = loadEnv(mode, process.cwd(), '');
const libInput = {
config: './src/config-entry.ts',
value: './src/value-entry.ts',
@@ -37,6 +37,8 @@ export default defineConfig(({ command, mode }) => {
const devInput = mode === 'lib' ? libInput : htmlInput;
const buildConfig = {
outDir: OUT_DIR || 'dist',
sourcemap: true,
cssCodeSplit: false,
@@ -67,7 +69,7 @@ export default defineConfig(({ command, mode }) => {
}
return {
base: '/tmagic-editor/playground/runtime/react',
base: BASE || '/tmagic-editor/playground/runtime/react',
plugins: [reactRefresh()],