A simple Dart development server that serves a web app, automatically refreshes on changes, and is compatible with single page apllications (SPA) that utilize the history API.
This package runs
pub run build_runner serve under the hood. So,
package: build_runner needs to be installed along with this package.
dev_dependencies: build_runner: ^0.7.13 build_web_compilers: ^0.3.0 livereload: ^0.4.0
pub get --no-precompile
pub run livereload
Then, browse your web app at http://localhost:8000.
If you are going to build an SPA, make sure to add a proper
<base> so that your routing works.
<!DOCTYPE html> <html lang="en"> <head> <!-- <base> is needed. --> <base href="/"> <script defer src="main.dart.js"></script> <title>SPA</title> </head> <body> <!-- AngularDart with angular_router --> <my-app>Loading...</my-app> </body> </html>
pub run livereload [directory] [options]
webwill be served.
build.<name>.yamlinstead of the default
optionsconfig for a builder by key. As an example, enabling the dart2js compiler would look like:
build_runnerserves. (defaults to "8080")
This package heavily relies on
build_runner stdout messages.
build_runner 0.7.13 changed some of the messages and broke this package. This release is a minor patch to fix the issue.
In this release, I want to heavily refactor the code and because no one is actually using the library except for its own CLI, a lot of stuff will be removed without properly deprecated.
--port, which should be less confusing.
shouldBeRewrittento rewrite any request which doesn't have a MIME type with 404 response to
buildRunnerServefunction is removed. Use
startWebSocketServerfunction is removed. Use
startLiveReloadWebSocketServerfunction is removed. Use
startProxyServerfunction is removed. Use
build_runner serveprocess and force the proxy server and the WebSocket server to close, closes #5.
rewriteAsis now deprecated. Use the newly added
startLiveReloadProxyServeris now deprecated. Use the now exposed
client.dartis not necessary anymore.
Add this to your package's pubspec.yaml file:
dependencies: livereload: ^0.4.1
You can install packages from the command line:
$ pub get
Alternatively, your editor might support
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
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]
The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.
Support Dart 2 in
The SDK constraint in
pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.
dartdoc successfully runs on your package's source files. (-10 points)
Dependencies were not resolved.
|Dart SDK||>=2.0.0-dev <2.0.0|