More work on bundling vite for production

This commit is contained in:
Jesse Wierzbinski 2023-12-06 14:29:26 -10:00
parent c8ffca37b1
commit d62e81977e
No known key found for this signature in database
7 changed files with 48 additions and 18 deletions

View file

@ -2,19 +2,12 @@ import { createApp } from "vue";
import "./style.css";
import "virtual:uno.css";
import { createRouter, createWebHistory } from "vue-router";
import Login from "./login.vue";
import App from "./App.vue";
const Home = { template: "<div>Home</div>" };
const routes = [
{ path: "/", component: Home },
{ path: "/oauth/authorize", component: Login },
];
import routes from "./routes";
const router = createRouter({
history: createWebHistory(),
routes,
routes: routes,
});
const app = createApp(App);

8
pages/routes.ts Normal file
View file

@ -0,0 +1,8 @@
import Login from "./login.vue";
const Home = { template: "<div>Home</div>" };
export default [
{ path: "/", component: Home },
{ path: "/oauth/authorize", component: Login },
];

View file

@ -5,7 +5,7 @@ import vue from "@vitejs/plugin-vue";
export default defineConfig({
base: "/",
build: {
outDir: "../vite-dist",
outDir: "./dist",
},
// main.ts is in pages/ directory
resolve: {