Change8

Migrating to Webpack v5.107.1

Version v5.107.1 introduces 2 breaking changes. This guide details how to update your code.

Released: 5/21/2026

2
Breaking Changes
1
Migration Steps
36
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

html tokenizer states (script-data, content-mode end-tag, attribute-value, EOF)decodeHtmlEntitiesHarmonyImportSideEffectDependency.getModuleEvaluationSideEffectsStateNormalModule.getSideEffectsConnectionStateNormalModuleFactorymodule.generator.htmlEmptyGeneratorOptionsHtmlGeneratorOptionsWebAssembly generator hooksEmptyParserOptionsNormalModuleFactory#getParserNormalModuleFactory#createParserNormalModuleFactory#getGeneratorNormalModuleFactory#createGeneratorHarmonyDetectionParserPlugindefine(...) callbacksoutput.filenamechunkFilenamecssFilenamecssChunkFilenamehtmlFilenamehtmlChunkFilenameoptimization.splitChunks.cacheGroups[*].filenameoutput.assetModuleFilenameper-module generator.filenamegenerator.outputPathmodule.parser.css.localIdentNameNormalModuleCreateDataResolveData.createDatawebpackPrefetchwebpackPreloadimport() call sites[fullhash:N][hash:N]RuntimePluginPublicPathRuntimeModule

Breaking Changes

Issue #1

{"fix":"For chunk filename callbacks (`output.filename`, etc.), `pathData.chunk` is now non-optional. For module filename callbacks (`output.assetModuleFilename`, etc.), `pathData.module` is now non-optional. Update code using these callbacks to ensure these properties are present when expected.","breaking_change":"Narrowing of `TemplatePathFn` callback types in filename template functions."}

Solution

For chunk filename callbacks (`output.filename`, etc.), `pathData.chunk` is now non-optional. For module filename callbacks (`output.assetModuleFilename`, etc.), `pathData.module` is now non-optional. Update code using these callbacks to ensure these properties are present when expected.

Issue #2

{"fix":"`CreateData` now includes `settings: ModuleSettings`. Plugins using `createModule`, `module`, or `createModuleClass` hooks should verify their type handling, although the fully populated data passed to `createModule` is now more strictly typed.","breaking_change":"Changes to `NormalModuleFactory` typedefs affecting plugin hooks."}

Solution

`CreateData` now includes `settings: ModuleSettings`. Plugins using `createModule`, `module`, or `createModuleClass` hooks should verify their type handling, although the fully populated data passed to `createModule` is now more strictly typed.

Migration Steps

  1. 1
    If you rely on the exact return types of `NormalModuleFactory#getParser` / `createParser` / `getGenerator` / `createGenerator`, update consumers as these methods are now generic and return specific parser/generator classes based on module type.

Release Summary

This patch significantly improves HTML tokenization alignment with WHATWG specs and enhances tree-shaking for CommonJS bindings. It also fixes critical issues related to side-effect analysis stack overflows and source map generation coexistence.

Need More Details?

View the full release notes and all changes for Webpack v5.107.1.

View Full Changelog