filename=[chunkhash] illegal only with HMR

I use output.filename = '[chunkhash:12].js' which works just fine (can’t use plain [hash] because of multiple entries), but when I try to run the same config with hot/HMR enabled I get the following error:

Cannot use [chunkhash] for chunk in '[chunkhash].js' (use [hash] instead)

It’s not really a problem, but it seems peculiar to me that it only applies to HMR.

Author: Fantashit

1 thought on “filename=[chunkhash] illegal only with HMR

  1. You can use [hash]-[id].js for multiple entry points.

    With HMR the entry chunk depends on the hash of the compilation and because of this [chunkhash] is not possible. (The filename must change with every recompilation not only when a module in the entry chunk changes)

Comments are closed.