-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bundle flutter.js via esbuild (#47573)
* Roll esbuild as a CIPD package along with the browser roller. I renamed `browser_lock`/`browser_roller` etc to `package_lock` and `package_roller` since it will handle more than just browsers now. * Download the esbuild CIPD package via DEPS. * Have a build rule for running esbuild on some JavaScript or TypeScript * Bundle and minify `flutter.js` using esbuild. * Include in `flutter_web_sdk` the original `flutter.js` source, the minified `flutter.js`, and a sourcemap file to map between thnm. * Also slightly changed the structure to put the `flutter.js` stuff in `flutter_web_sdk/flutter_js` instead of just at the root level of `flutter_web_sdk`. This should be fine because I haven't merged the change that has the flutter tool consume this yet.
- Loading branch information
1 parent
035740c
commit 43db22e
Showing
16 changed files
with
274 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright 2013 The Flutter Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import("//flutter/common/config.gni") | ||
|
||
template("esbuild") { | ||
assert(defined(invoker.entry_point)) | ||
assert(defined(invoker.output_bundle)) | ||
action(target_name) { | ||
forward_variables_from(invoker, [ "public_deps" ]) | ||
if (host_os == "win") { | ||
executable_subpath = "esbuild.exe" | ||
} else { | ||
executable_subpath = "bin/esbuild" | ||
} | ||
esbuild = "$host_prebuilts_path/esbuild/$executable_subpath" | ||
|
||
script = "//build/gn_run_binary.py" | ||
inputs = [ | ||
esbuild, | ||
invoker.entry_point, | ||
] | ||
outputs = [ invoker.output_bundle ] | ||
absolute_output = rebase_path(invoker.output_bundle) | ||
args = [ rebase_path(esbuild, root_build_dir) ] | ||
if (defined(invoker.bundle) && invoker.bundle) { | ||
args += [ "--bundle" ] | ||
} | ||
if (defined(invoker.minify) && invoker.minify) { | ||
args += [ "--minify" ] | ||
} | ||
if (defined(invoker.sourcemap) && invoker.sourcemap) { | ||
args += [ "--sourcemap" ] | ||
outputs += [ invoker.output_bundle + ".map" ] | ||
} | ||
args += [ | ||
"--outdir=$absolute_output", | ||
rebase_path(invoker.entry_point), | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,6 @@ firefox: | |
|
||
edge: | ||
launcher_version: '1.2.0.0' | ||
|
||
esbuild: | ||
version: '0.19.5' |
Oops, something went wrong.