Skip to content

Commit

Permalink
Refactor patch
Browse files Browse the repository at this point in the history
  • Loading branch information
fallaciousreasoning committed May 3, 2023
1 parent cd5927a commit 02e8cae
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
11 changes: 11 additions & 0 deletions chromium_src/ui/webui/resources/tools/optimize_webui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright (c) 2023 The Brave Authors. All rights reserved.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.

# This variable comes from the upstream file, so disable the pylint warning
# about undefined variables.
# pylint: disable=E0602
_BASE_EXCLUDES.extend([
"chrome://resources/brave/leo/bundle.js", "//resources/brave/leo/bundle.js"
])
18 changes: 9 additions & 9 deletions patches/ui-webui-resources-tools-optimize_webui.py.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
diff --git a/ui/webui/resources/tools/optimize_webui.py b/ui/webui/resources/tools/optimize_webui.py
index 6b5978eeb4145..1242551f785e7 100755
index 6b5978eeb4145..116804784f91d 100755
--- a/ui/webui/resources/tools/optimize_webui.py
+++ b/ui/webui/resources/tools/optimize_webui.py
@@ -32,6 +32,7 @@ for excluded_file in [
'resources/js/cr.js', # This file relies on globals.
'resources/js/load_time_data.js',
'resources/ash/common/load_time_data.m.js',
+ 'resources/brave/leo/bundle.js',
]:
# Exclude both the chrome://resources form and the scheme-relative form for
# files used in Polymer 3.
@@ -313,6 +313,6 @@ def main(argv):
optimize_output['js_module_out_files'][0])
_update_dep_file(args.input, args, dep_file_header, manifest)

-
+from import_inline import inline_file_from_src; inline_file_from_src("brave/chromium_src/ui/webui/resources/tools/optimize_webui.py", globals(), locals())
if __name__ == '__main__':
main(sys.argv[1:])

0 comments on commit 02e8cae

Please sign in to comment.