Skip to content
Discussion options

You must be logged in to vote
npm i -D morgan @types/morgan
// vite.config.ts

import { unstable_vitePlugin as remix } from "@remix-run/dev";
import morgan from "morgan";
import { defineConfig, type ViteDevServer } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
  plugins: [morganPlugin(), remix(), tsconfigPaths()],
});

function morganPlugin() {
  return {
    name: "morgan-plugin",
    configureServer(server: ViteDevServer) {
      return () => {
        server.middlewares.use(morgan("tiny"));
      };
    },
  };
}

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@saschatimme
Comment options

@kiliman
Comment options

@sergiodxa
Comment options

@lifeiscontent
Comment options

Answer selected by sergiodxa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants