@morghulis/core
v1.0.54
Published
add server for local develop with valar
Downloads
2,673
Readme
1. vite.config.js (dev mode)
add server for local develop with valar
import {fileURLToPath, URL} from 'node:url'
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
export default defineConfig({
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
server: {
host: '0.0.0.0',
open: false,
proxy: {
'/api': {
target: `http://localhost:8000`,
changeOrigin: true,
ws: true,
rewrite: path => path.replace(/^\/api/, '')
},
},
},
})- main.ts
import {createApp, h} from 'vue'
import {createMorghulis, MApp} from "@morghulis/core";
import ElementPlus from 'element-plus'
import '@morghulis/core/style'
import {options} from "./options";
import {createPinia} from "pinia";
const app = createApp(MApp)
app.use(createPinia())
app.use(ElementPlus)
app.use(createMorghulis(options))
app.mount('#app')- options.ts
import App from "./App.vue";
import type {Options} from "@morghulis/core";
export const options: Options = {
title: 'Valar Morghulis',
signInOnly: false,
account: {
// label: 'Phone Number'
},
routes: [
{
path: '/',
name: '主页',
component: App
},
],
icons: []
}