Skip to content

[Proposal] Support --base-href for flutter run #163141

Description

@markbeij

Use case

I want to test my web app when it runs in a subfolder. When I build the web app, I can use the flag --base-href to supply the correct subfolder the web app will be hosted at. This flag is however not available for the flutter run command.

In VS Code I have the following configuration

{
    "name": "portal (in subfolder)",
    "type": "dart",
    "request": "launch",
    "program": "clients/portal/lib/main.dart",
    "args": [
        "--web-launch-url=http://localhost:8080/preview",
        "--web-port=8080",
        "--web-browser-flag=--disable-web-security",
    ]
},

Adding --base-href=/preview/ as an argument results in the error:
Could not find an option named "base-href".

Proposal

Add --base-href to the flutter run command.

Or maybe consider to support all flags that are supported by flutter build command, if that makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterteam-webOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions