@oriflame/constant-moduleids-webpack-plugin

1.1.0 • Public • Published

In its basic form HashedModuleIdsPlugin and DeterministicModuleIdsPlugin both use Module.identifier() as a source for final moduleId. It is true that generated ids by these plugins are based on module name/path but it is not always only the module name. In some cases webpack internally creates a ConcatenatedModule for multiple internal modules for one main module and then identifier contains something like <module name>|<hash of all internal modules>.

This id can change between multiple builds even when the version of some dependency (main module) doesn't change. It is probably caused by using different number of internal modules. And this volatility is a problem when the result bundle is used as a DLL with DLLReferencePlugin. Every consumer would have to rebuild its bundle every time the dll bundle would change (every change, even patch, would have to be treated as a breaking).

This plugin replaces the use of Module.identifier() with Module.libIdent() (resp. getFullModuleName with getShortModuleName) which results in only the name of module being used. That way moduleIds never change and can be relied on.

Package Sidebar

Install

npm i @oriflame/constant-moduleids-webpack-plugin

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

6.31 kB

Total Files

5

Last publish

Collaborators

  • samanekm
  • ondrej_langr.oriflame
  • jan.novotny.oriflame
  • cfmano
  • jakubmazanec
  • ori-development