Skip to content

feat(vite): Use the file names listed in the 'manifest.json' file as the 'server-entry' entry file.#3595

Open
cuipeiyu wants to merge 1 commit intodenoland:mainfrom
cuipeiyu:server-entry-filename
Open

feat(vite): Use the file names listed in the 'manifest.json' file as the 'server-entry' entry file.#3595
cuipeiyu wants to merge 1 commit intodenoland:mainfrom
cuipeiyu:server-entry-filename

Conversation

@cuipeiyu
Copy link

@cuipeiyu cuipeiyu commented Nov 4, 2025

  • When the rollupOptions option in vite.config.ts is enabled, the server entry will point to the incorrect path.
export default defineConfig({
  plugins: [ 
    fresh(),
    tailwind(),
  ],
  build: {
    rollupOptions: {
      output: {
        chunkFileNames: `[hash].mjs`,
        entryFileNames: `[hash].mjs`,
        assetFileNames: `[hash].[ext]`,
      },
    },
  },
});
  • The server.js will be like:
import server, { registerStaticFile } from "./server/DGQDB4pi.mjs";

// registerStaticFile......

export default {
  fetch: server.fetch
};

Copy link
Collaborator

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, let's add a test for that

Copy link
Collaborator

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Let's add a test case for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants