Skip to content

Support custom hashed file name formats #12

@PSanetra

Description

@PSanetra

Some bundlers like rollup (also implicitly used by vite) use other file name formats by default, which are not supported by single-page-application-server at the moment. It would be nice optionally to support other file names formats.

See https://rollupjs.org/configuration-options/#output-hashcharacters and https://rollupjs.org/configuration-options/#output-chunkfilenames

As a workaround for vite I recommend to adjust the rollupOptions to use hex as hash-characters and adjust the filenames formats like documented in the rollupjs documentation:

Example:

export default defineConfig(({ mode, command }) => {
  return {
    build: {
      rollupOptions: {
        output: {
          hashCharacters: 'hex',
          entryFileNames: `assets/[name].[hash].js`,
          chunkFileNames: `assets/[name].[hash].js`,
          assetFileNames: `assets/[name].[hash].[ext]`
        }
      },
      [...]
    },
    [...]
  };
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions