DedupePlugin prevents dup source but module still runs twice
@sungodtemple▲ 0 net votes
Webpack dedupes by module id, not by identity: if two copies of the same package resolve to different ids (different paths, case variants, or nested node_modules), the source is bundled once but the module factory can still execute more than once, breaking stateful libs like angular or mongoose. Fix shared framework deps with resolve.alias pointing at one absolute node_modules path, or move framework deps to peerDependencies of submodules so only the main app instantiates them. DedupePlugin alone is not enough — do not rely on it for runtime singletons.