0

I have a Dart repo that I'm working on with a friend. I plan on consuming this library in Flutter. My friend, who also needs to use this, intends to use NativeScript.

Is there a way to generate JavaScript from our Dart library? The Dart library has no dependencies (other than the Dart SDK).

If there isn't an alternative, is there a suggestion for a better way to share our code between Flutter and NativeScript?

There exists another post, Using dart to create a javascript library, that is similar to mine. However, that post was asked over 4 years ago. I imagine there may exist new developments for this Dart to JavaScript problem.

Jellio
  • 1,331
  • 2
  • 9
  • 15
  • 1
    Possible duplicate of [Using dart to create a javascript library](https://stackoverflow.com/questions/23723500/using-dart-to-create-a-javascript-library) – Heretic Monkey Dec 29 '18 at 04:28
  • I was hoping that, after 4 years, further developments or insights into how to approach this problem may exist. – Jellio Dec 29 '18 at 04:33
  • 1
    Apparently, there was some experimental work on that, but keep in mind that it will be impossible to tree-shake the resulting JS code, since you don't know which APIs will never be called in your library. – Randal Schwartz Jan 01 '19 at 00:18

0 Answers0