What is the reason for the /canvaskit/ folder in flutter wen builds

Hi there :) I recently noticed that a new /canvaskit/ folder was added to web projects in Flutter. See here. The folder is included no matter what web renderer is chosen when running 'flutter build web'. The folder is very large, 16-ish MB. Does anyone know why this folder is suddenly present in builds?


Solution 1:

We have a couple of items to finish before this is complete (bundling fallback fonts, tooling, documentation), but this is the first step towards fully self-contained apps and out-of-the-box offline PWA support (https://github.com/flutter/flutter/issues/60069). We currently use it when running tests (it's faster and more stable when loaded from a local file vs from the network). You can use it today by adding the following to your index.html before loading main.dart.js:

<script>
  window.flutterConfiguration = {
    canvasKitBaseUrl: "/canvaskit/"
  };
</script>