With the expiration of Dartium that happened just a few days ago, I felt compelled to migrate from dart 1.24.3 to Dart2, even though it is still in dev.
I have although hit a few walls doing so, one of them being related to the architecture of my apps.
I run a nodeJs server, which also acts as a webserver with client side dart.
The problem that I experience with the new dart SDK is that in order for the .dart files to be read in Chrome, they must be served using
webdev serve or
Obviously, these 2 commands act as the file server, which is not what I want since I’m using a nodeJS server.
build_runner watch I think I am enabling the build and watch of the .dart files into .dart.js inside of the following directory :
I am also able to serve them from my nodeJS server. What remains is the package directory, I can’t seem to find where pub serves gets the following package files:
Does anyone know what build_runner serve does to include them?
There are 2 options for using a different server during development.
build_runner serveon a different port and proxy the requests to it from your other server. This has the benefit of delaying requests while a build is ongoing so you don’t get an inconsistent set of assets.
build_runner watch --output web:buildand use the created
build/directory to serve files from. This will include a
build/packagesdirectory that has these files in it.
Answered By – Nate Bosch
Answer Checked By – Terry (FlutterFixes Volunteer)