Migrate heap_snapshot_worker/ to ESM internally

Bug: 1006759
Change-Id: I5d2d975c08a4b20d79c61fcbfdf75edaf903ea4d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2013147
Commit-Queue: Tim van der Lippe <[email protected]>
Reviewed-by: Paul Lewis <[email protected]>
diff --git a/BUILD.gn b/BUILD.gn
index e4af1a0..87ba28c 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -693,6 +693,7 @@
   "front_end/heap_snapshot_model/HeapSnapshotModel.js",
   "front_end/heap_snapshot_worker/AllocationProfile.js",
   "front_end/heap_snapshot_worker/heap_snapshot_worker.js",
+  "front_end/heap_snapshot_worker/heap_snapshot_worker-legacy.js",
   "front_end/heap_snapshot_worker/HeapSnapshot.js",
   "front_end/heap_snapshot_worker/HeapSnapshotLoader.js",
   "front_end/heap_snapshot_worker/HeapSnapshotWorker.js",
@@ -1604,6 +1605,7 @@
   "$resources_out_dir/heap_snapshot_model/HeapSnapshotModel.js",
   "$resources_out_dir/heap_snapshot_worker/AllocationProfile.js",
   "$resources_out_dir/heap_snapshot_worker/heap_snapshot_worker.js",
+  "$resources_out_dir/heap_snapshot_worker/heap_snapshot_worker-legacy.js",
   "$resources_out_dir/heap_snapshot_worker/HeapSnapshot.js",
   "$resources_out_dir/heap_snapshot_worker/HeapSnapshotLoader.js",
   "$resources_out_dir/heap_snapshot_worker/HeapSnapshotWorker.js",
@@ -2161,6 +2163,12 @@
   "$resources_out_dir/sources_test_runner/sources_test_runner_module.js",
 ]
 
+all_worker_entrypoints = [
+  "front_end/formatter_worker_entrypoint.js",
+  "front_end/heap_snapshot_worker_entrypoint.js",
+  "front_end/wasmparser_worker_entrypoint.js",
+]
+
 generated_worker_bundles = [
   "$resources_out_dir/formatter_worker_entrypoint.js",
   "$resources_out_dir/heap_snapshot_worker_entrypoint.js",
@@ -2362,6 +2370,7 @@
   inputs =
       helper_scripts + all_devtools_files + devtools_test_files +
       generated_scripts + generated_aria_properties + application_templates +
+      all_worker_entrypoints +
       # In `build_release_applications` we sometimes include
       # the content of Runtime.js into the build output.
       [ "front_end/Runtime.js" ]