Skip to content

[web] Support content-hashed entrypoint filenames (--web-content-hash) #191914

Closed

Description

@kevmoo

Summary

Part of umbrella issue #149031.

Support content-hashing compiled top-level JavaScript and WebAssembly entrypoint binaries (main.dart.<hash>.js, main.dart.<hash>.wasm, main.dart.<hash>.mjs, and associated .js.map / .mjs.map files) when building Flutter Web with --web-content-hash.

Scope & Requirements

  • Add --web-content-hash flag descriptor in WebOptions (flutter_tools).
  • Compute SHA-256 content hashes of compiled entrypoints in Dart2JSTarget and Dart2WasmTarget.
  • Dynamically inject the resolved hashed entrypoint paths into _flutter.buildConfig inside flutter_bootstrap.js.
  • Preserve unhashed main.dart.wasm.map to maintain WebAssembly binary sourceMappingURL custom section integrity.
  • Prune stale hashed entrypoint files from build/web/ across repeated builds.
  • Fast-fail build if legacy web/index.html contains direct <script src="main.dart.js"> tags or deprecated FlutterLoader.loadEntrypoint calls.

Pull Request

In flight in #190153.

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-webWeb applications specifically
    P2Important issues not at the top of the work list
    team-webOwned by Web platform team
    on Aug 27, 2026
  2. added 2 commits that reference this issue on Sep 10, 2026
    f798084
    bdb24b7
  3. github-actions commented on Sep 24, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listplatform-webWeb applications specificallyteam-webOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions