Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/browser/resources/vulcanize_gn.py

Issue 2921793002: WebUI: Replace uglifyjs with uglify-es which understands ES6. (Closed)
Patch Set: Resolve conflicts. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/node/node_modules.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import itertools 7 import itertools
8 import os 8 import os
9 import platform 9 import platform
10 import re 10 import re
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 with open(html_out_path, 'r+') as f: 181 with open(html_out_path, 'r+') as f:
182 data = f.read() 182 data = f.read()
183 new_data = data.replace( 183 new_data = data.replace(
184 '</body></html>', 184 '</body></html>',
185 '<script src="' + args.js_out_file + '"></script></body></html>') 185 '<script src="' + args.js_out_file + '"></script></body></html>')
186 assert new_data != data, 'Expected to find </body></html> token.' 186 assert new_data != data, 'Expected to find </body></html> token.'
187 f.seek(0) 187 f.seek(0)
188 f.write(new_data) 188 f.write(new_data)
189 f.truncate() 189 f.truncate()
190 190
191 node.RunNode([node_modules.PathToUglifyJs(), crisper_output.name, 191 node.RunNode([node_modules.PathToUglify(), crisper_output.name,
192 '--comments', '"/Copyright|license|LICENSE|\<\/?if/"', 192 '--comments', '"/Copyright|license|LICENSE|\<\/?if/"',
193 '--output', js_out_path]) 193 '--output', js_out_path])
194 finally: 194 finally:
195 if os.path.exists(crisper_input.name): 195 if os.path.exists(crisper_input.name):
196 os.remove(crisper_input.name) 196 os.remove(crisper_input.name)
197 if os.path.exists(crisper_output.name): 197 if os.path.exists(crisper_output.name):
198 os.remove(crisper_output.name) 198 os.remove(crisper_output.name)
199 199
200 200
201 def main(argv): 201 def main(argv):
(...skipping 15 matching lines...) Expand all
217 args.depfile = os.path.normpath(args.depfile) 217 args.depfile = os.path.normpath(args.depfile)
218 args.input = os.path.normpath(args.input) 218 args.input = os.path.normpath(args.input)
219 args.out_folder = os.path.normpath(args.out_folder) 219 args.out_folder = os.path.normpath(args.out_folder)
220 220
221 _vulcanize(args.input, args) 221 _vulcanize(args.input, args)
222 _update_dep_file(args.input, args) 222 _update_dep_file(args.input, args)
223 223
224 224
225 if __name__ == '__main__': 225 if __name__ == '__main__':
226 main(sys.argv[1:]) 226 main(sys.argv[1:])
OLDNEW
« no previous file with comments | « no previous file | third_party/node/node_modules.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698