How do I pass arguments to Web UI's dwc compiler from build.dart?


I want to turn off URL rewriting by dwc (the Web UI compiler). I run dwc via build.dart. How do I pass an argument from build.dart down to dwc?


Any arguments after -- will be passed to dwc.

void main() {
  var args = new List.from(new Options().arguments);
  args.addAll(['--', '--no-rewrite-urls']);

  build(args, ['web/clock_page.html']);

Read more about dwc.

Answered By – Seth Ladd

Answer Checked By – Mary Flores (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *