webdev 2.5.4

  • Readme
  • Changelog
  • Installing
  • 79

Pub Package Build Status

A command-line tool for developing and deploying web applications with Dart.

Requirements #

The latest release of webdev requires Dart SDK 2.3 or later. This corresponds to Flutter SDK 1.5 or later.

To use webdev with a package, make sure you have entries in pubspec.yaml similar to:

  build_runner: ^1.6.2
  build_web_compilers: ^2.0.0

build_web_compilers ^1.2.0 is supported, but with some limited functionality.

Installation #

webdev is not meant to be used as a dependency. Instead, it should be "activated".

$ pub global activate webdev
# or
$ flutter pub global activate webdev

Learn more about activating and using packages here.

Usage #

webdev provides two commands: serve and build.

webdev serve #

Run a local web development server and a file system watcher that rebuilds on

Usage: webdev serve [arguments] [<directory>[:<port>]]...
    --auto                        Automatically performs an action after each

                                  restart: Reload modules and re-invoke main
                                  (loses current state)
                                  refresh: Performs a full page refresh.
                                  [restart, refresh]

    --[no-]debug                  Enable the launching of DevTools (Alt + D /
                                  Option + D). This also enables

    --[no-]debug-extension        Enable the backend for the Dart Debug

    --[no-]injected-client        Whether or not to inject the client.js script
                                  in web apps. This is required for all
                                  debugging related features, but may interact
                                  poorly with proxy servers or other
                                  (defaults to on)

    --chrome-debug-port           Specify which port the Chrome debugger is
                                  listening on. If used with launch-in-chrome
                                  Chrome will be started with the debugger
                                  listening on this port.

    --hostname                    Specify the hostname to serve on.
                                  (defaults to "localhost")

    --[no-]launch-in-chrome       Automatically launches your application in
                                  Chrome with the debug port open. Use
                                  chrome-debug-port to specify a specific port
                                  to attach to an already running chrome
                                  instance instead.

    --log-requests                Enables logging for each request to the

    --tls-cert-chain              The file location to a TLS Certificate to
                                  create an HTTPs server.
                                  Must be used with tls-cert-key.

    --tls-cert-key                The file location to a TLS Key to create an
                                  HTTPs server.
                                  Must be used with tls-cert-chain.

-h, --help                        Print this usage information.
-o, --output                      A directory to write the result of a build to.
                                  Or a mapping from a top-level directory in the
                                  package to the directory to write a filtered
                                  build output to. For example "web:deploy".
                                  A value of "NONE" indicates that no "--output"
                                  value should be passed to `build_runner`.
                                  (defaults to "NONE")

-r, --[no-]release                Build with release mode defaults for builders.
    --[no-]build-web-compilers    If a dependency on `build_web_compilers` is
                                  required to run.
                                  (defaults to on)

-v, --verbose                     Enables verbose logging.

Run "webdev help" to see global options.

webdev build #

Run builders to build a package.

Usage: webdev build [arguments]
-h, --help                        Print this usage information.
-o, --output                      A directory to write the result of a build to.
                                  Or a mapping from a top-level directory in the
                                  package to the directory to write a filtered
                                  build output to. For example "web:deploy".
                                  A value of "NONE" indicates that no "--output"
                                  value should be passed to `build_runner`.
                                  (defaults to "web:build")

-r, --[no-]release                Build with release mode defaults for builders.
                                  (defaults to on)

    --[no-]build-web-compilers    If a dependency on `build_web_compilers` is
                                  required to run.
                                  (defaults to on)

-v, --verbose                     Enables verbose logging.

Run "webdev help" to see global options.

2.5.4 #

  • Fix support for --output=NONE when building.
  • Properly error if not in a Dart root while running the daemon command.
  • Depend on the latest package:sse.
  • Serve DevTools if either --debug or --debug-extension is provided.
  • Publicize the option --debug-extension.

2.5.3 #

  • Added a new --launch-app command line option.
    • Expects a package relative path to an html file, such as web/app.html.
    • Launches the specified application in chrome on startup instead of the server root.
    • Allows multiple apps, and will launch all of them.
    • Supported for the daemon and serve commands.
  • Depend on the latest package:dwds.

2.5.2 #

  • Update SDK dependency to minimum of 2.5.0.
  • Support absolute file: URIs for libraries.
  • Depend on the latest package:dwds.

2.5.1 #

  • Depend on the latest package:dwds.

2.5.0 #

  • TLS support has been added to the serve command through the addition of two new options tls-cert-chain and tls-cert-key.
  • Added an explicit error if asked to build or serve anything other than a top level directory under a package. This never worked before but silently didn't actually do what the user expected.

2.4.1 #

  • Depend on the latest package:webkit_inspection_protocol.

2.4.0 #

  • Add a --no-injected-client option which can be used to work around issues relating to the injected client.js file. All debugging features must be disabled if you use this option.
  • Depend on the latest package:dwds.

2.3.0 #

  • Depend on the latest package:dwds.
  • Depend on the latest package:build_daemon.

2.2.0 #

  • Added a fullReload service extension which performs a full page refresh.
  • Handle shutdown notifications from latest build_daemon protocol.

2.1.0 #

  • Add an explicit error if there are no directories to serve. Typically this would happen if the user doesn't have a web directory.
  • Add support for specifying --hostname any.
  • DevTools no longer launches in a new window. This prevents an issue where pausing your application also pauses DevTools.
  • Fix some edge cases for hot restart:
    • All restarts will now fire isolate create/destroy events, regardless of how they are triggered.
    • Fix a bug in the module invalidation/reload logic.

2.0.7 #

  • Update minimum package:build_runner version to 1.5.0.
  • Use HttpMultiServer to fix bind issues with IPv6 / IPv4.

2.0.6 #

  • Use latest package:build_daemon.

2.0.5 #

  • Use HttpMultiServer to fix bind issues with IPv6 / IPv4.

2.0.4 #

  • Fix loading apps in non-chrome browsers in --debug mode
    • Add a nice error if attempting to launch devtools in non-chrome browsers.
  • Detect flutter and flutter_test dependencies and fail with a nice message.

2.0.3 #

  • Support latest package:build_daemon.
  • Fix Chrome issues while running through VS Code.

2.0.2 #

  • Support package:dwds version 0.3.0.

2.0.1 #

  • Fix launching Chrome on Windows.

2.0.0 #

Breaking Changes #

  • The serve command will now only serve web by default.
  • Deprecated the --hot-reload and --live-reload flags, in favor of the new --auto=<action> option which performs an action whenever a build completes.
    • The current supported actions are restart and refresh, which correspond to the old --hot-reload and --live-reload flags.
  • Support building with package:build_daemon. This allows shared builds as long as the build arguments are compatible.
    • This should not affect most users but might break some workflows.
    • Prompts are not supported, so you may have to pass the -- --delete-conflicting-outputs argument if you used to hit y at the prompt.

Features #

  • Added the --debug flag.
    • Runs a proxy dart vm service with limited functionality, which talks to the running in chrome.
    • Enables devtools for web apps.
      • For regular web apps currently this doesn't actually do anything yet, except for supported frameworks which will enable some tabs.
      • Use alt+d (or option+d on Mac) in the web app to launch devtools.
  • Allow build_web_compilers 2.x.

1.0.1 #

  • Support package:build_web_compilers v1.0.0.

1.0.0 #

  • Support package:build_runner v1.0.0.
  • Add --version to CLI.

0.2.5 #

  • Added support for the --hot-reload flag, if on build_runner >=0.10.2.

0.2.4+1 #

  • Print Creating build script on startup so the user is aware of what the process is doing.

0.2.4 #

  • Added support for the --live-reload flag, if on build_runner >=0.10.1.

0.2.3+2 #

  • Support latest package:build_runner.

0.2.3+1 #

  • Support Dart 2 stable.

0.2.3 #

  • Update required Dart SDK and package:build_runner to support latest versions.

0.2.2 #

  • Add default value for --output to be build:web for the build command and NONE for the serve command.
  • Update to use lower-case constants from Dart ^2.0.0-dev.54.

0.2.1 #

  • Support package:build_web_compilers v0.4.0.
  • Always pass the argument --fail-on-severe to the build command.
  • Exit with an error if unsupported arguments are passed to build command.

0.2.0 #

  • Pass the arguments supporting directory:port for the serve command.
  • Add the requirement for build_web_compilers to build command.
  • Renamed --require-build-web-compilers flag to --build-web-compilers.

0.1.4 #

  • Require and use features from build_runner 0.8.2.
    • Added a --[no]-release flag.
  • Require build_web_compliers 0.3.6 when running serve.
    • Unless the --no-require-build-web-compilers flag is provided.

0.1.3+1 #

  • Support running pub when it's not in the environment path.

0.1.3 #

  • Now runs on Windows.

0.1.2 #

  • Remove check for build_web_compilers. Allows general support for build_runner from tools.
  • Use pub deps to validate target directory.

0.1.1 #

  • Checks for a dependency on build_web_compilers.
  • Gracefully handle exceptions.

0.1.0 #

  • Initial release. Supports basic invocation of build and serve with build_runner: ^0.8.0.

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate webdev

2. Use it

The package has the following executables:

$ webdev
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Maintenance issues and suggestions

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (dwds, vm_service).


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.2-dev.0.1 <3.0.0
args ^1.5.0 1.5.2
async ^2.2.0 2.4.0
browser_launcher ^0.1.5 0.1.5
build_daemon ^2.0.0 2.1.3
crypto ^2.0.6 2.1.4
dwds ^0.8.0 0.8.5 0.9.0
http ^0.12.0 0.12.0+4
http_multi_server ^2.1.0 2.1.0
io ^0.3.2+1 0.3.3
logging ^0.11.0 0.11.4
meta ^1.1.2 1.1.8
path ^1.5.1 1.6.4
pedantic ^1.5.0 1.9.0
pub_semver ^1.3.2 1.4.2
pubspec_parse ^0.1.4 0.1.5
shelf ^0.7.4 0.7.5
shelf_proxy ^0.1.0+5 0.1.0+7
shelf_static ^0.2.8 0.2.8
sse ^3.0.0 3.1.1
vm_service ^1.1.0 1.2.0 2.3.1
webkit_inspection_protocol >=0.4.0 <0.6.0 0.5.0
yaml ^2.1.13 2.2.0
Transitive dependencies
built_collection 4.3.2
built_value 7.0.8
charcode 1.1.2
checked_yaml 1.0.2
collection 1.14.12
convert 2.1.1
devtools 0.1.8-dev.1 0.1.13
devtools_server 0.1.9 0.1.12
fixnum 0.10.11
http_parser 3.1.3
json_annotation 3.0.1
matcher 0.12.6
mime 0.9.6+3
package_config 1.1.0 2.0.0
package_resolver 1.0.10
pool 1.4.0
quiver 2.1.2+1
shelf_web_socket 0.2.3
source_maps 0.10.8
source_span 1.6.0
stack_trace 1.9.3
stream_channel 2.0.0
stream_transform 1.1.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
uuid 2.0.4
watcher 0.9.7+13
web_socket_channel 1.1.0
Dev dependencies
build ^1.0.0
build_runner ^1.6.2
build_verify ^1.0.0
build_version ^2.0.0
test ^1.6.0
test_descriptor ^1.0.3
test_process ^1.0.1
webdriver ^2.0.0