I want to use Dart as business project which will deploy on a customer's server.
At present I just know upload the whole source code to the server, there is no privacy...
How to do it?
I assume you are talking about Dart server code. Client code is transpiled to JavaScript, tree-shaken, and minified. This is quite some obfuscation.
For server side code you can use snapshots.
https://www.dartlang.org/articles/snapshots/. Snapshots still contain the readable source but everything packed into one file.
See also What is the difference between Dart's snapshots and Java bytecode?
There is ongoing work to create precompiled snapshots.
Normally Dart code is compiled at runtime before a function is executed the first time. For precompiled snapshots Dart source is compiled ahead of time.
Running
dart --gen-precompiled-snapshot
prints
Precompiled snapshots must be generated with dart_bootstrap. Usage: dart [] []
I haven't found a dart_bootstrap
command in the SDK.
I guess we will have to wait a bit more until this feature will be made available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With