Skip to content

Support hashing of bundles for cache breaking #2

@mattoni

Description

@mattoni

Hi everyone,

So a very common set up is to hash bundles so that the client can cache them, but download new content whenever the bundle is updated ( and therefore will have a new hash ). However, we need to know the names of the files generated in order to serve them properly. I think I saw before that there was support for a hash() method on the "factory", but I may be mistaken.

In order to support this, I propose a hash option be added to a bundle config, with the type of hashing desired.

fuse.bundle("client/app")
    .watch("client/**")
    .hmr()
    .hash("md5")
    .instructions(" > client/index.ts");

then, we need the ability to get the names of bundles created. I was thinking as an async return from run, but if we're in watch-mode that may present some challenges, so I'm not sure the best way to retrieve the generated bundle names. Any input is welcome.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions