-1

is it possible to filter dart files during 'pub build => dart2js' ?

I'm working with a microservice architecture where I need to specify a variable in the code according to the environement type ( integration vs production).

The common use case is to specify the server url

bwnyasse
  • 591
  • 1
  • 10
  • 15
  • Some similar questions, not sure what you exactly try to accomplish http://stackoverflow.com/questions/24482536/is-there-a-nice-way-to-have-different-configurations-for-different-environments/24483485#24483485, http://stackoverflow.com/questions/22519574/dart-how-to-use-different-settings-in-debug-and-production-mode, http://stackoverflow.com/questions/21338688/how-to-achieve-precompiler-directive-like-functionality, http://stackoverflow.com/questions/20288002/is-there-a-compiler-preprocessor-in-dart – Günter Zöchbauer Jul 08 '16 at 14:01

1 Answers1

0

It looks like you're looking for transformers option in pubspec.yml.

See what transformers can do: https://www.dartlang.org/tools/pub/assets-and-transformers.html

How to write a custom transformer: https://www.dartlang.org/tools/pub/transformers/index.html

martin
  • 93,354
  • 25
  • 191
  • 226