Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize generatedCode info to fix bug in asset module cache restoration #16703

Merged

Commits on Feb 7, 2023

  1. Serialize code generator data to support generated assets

    AssetGenerator calls out in a TODO-comment that the filename, assetInfo,
    and fullContentHash values must be captured in the 'data' object that's
    populated during code generation in order to be accessible in the
    AssetModulesPlugin. It notes that it must store them in the code
    generation results because it will be cached, but that appears to be
    incorrect as data is a simple Map that's instantiated within the
    NormalModule and not captured anywhere that would be cached.
    
    As a result, configurations that use the asset/resource type and make
    changes to assets between cached builds will result in a runtime error
    as Webpack is able to access the file from cache but isn't able to
    access the expected values from the data object.
    
    This solution captures the data object as a property of the NormalModule
    and hooks in to the existing serialize/deserialize functionality in
    order to make this value available across cached builds.
    ryanwilsonperkin committed Feb 7, 2023
    Copy the full SHA
    dcc3e71 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    dfaa3b4 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2023

  1. Copy the full SHA
    4d561a6 View commit details
    Browse the repository at this point in the history