示例工程 06-dev-debug-logging

06-dev-debug-logging/app/vite.preload.config.mts

typescript · 0.4 KB

import { defineConfig } from "vite";

export default defineConfig({
  build: {
    rollupOptions: {
      output: {
        // main 与 preload 的入口都叫 index.ts,默认 [name].cjs 会互相覆盖。
        // 显式命名,保证 .vite/build 下同时存在 index.cjs 与 preload.cjs。
        entryFileNames: "preload.cjs",
        chunkFileNames: "preload.cjs",
      },
    },
  },
});