Why doesn't a "pub build" skillfully build what a "pub service" serves?

Using current version angular.dart.tutorial using Chapter_04

  • With "pub serve", main.dart.js is 42337 lines file and the example works fine.
  • With "pub build", main.dart.js is a 22539 line file and this example does NOT work when I serve it through a http webserver.

I have a content, something about transformers.

My concern is that I'm working on an Angular Dart app that works fine with "pub serve", but when I deploy it through a web app server, it doesn't work. This web application server will provide services not written to Dart, where my client side is written in Dart with Angular.dart.

+3


source to share


1 answer


pub serve

default is used --mode=debug

, pub build

(from console) uses --mode=release

by default.

I haven't tried it pub serve --mode=release

, but I'm guessing it leads to the same output from als pub build

.

I've tried --mode=release

with pub serve

, but it doesn't seem to have any effect.



Release mode makes shaking and minimizing the tree.

+4


source







All Articles