简体   繁体   中英

Why “pub build” do not build excatly what “pub serve” is serving?

Using the current version of angular.dart.tutorial , Using the Chapter_04

  • With "pub serve", the main.dart.js is a 42337 lines file and the example is working fine.
  • With "pub build", the main.dart.js is a 22539 lines file and the example is NOT working when I'm serving it through an http web server.

I have the filling that it's something about the transformers.

My concern here is that, I'm working on a Angular Dart application which is working fine using "pub serve", but when I deploy it through a web application server it's not working. This web application server will provide services NOT written in Dart on which my client side written in Dart with Angular.dart rely on.

pub serve uses --mode=debug by default, pub build (from console) uses --mode=release as default.

I haven't tried pub serve --mode=release but I assume it results in the same output als pub build .
I tried --mode=release with pub serve but it seems not to have any effect.

Release mode does tree-shaking and minification.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM