I am currently working on an integration of Dart into the Rails Asset Pipeline.
Compilation is already working; .dart
files are compiled into .js
by the Asset Pipeline. However, there should also be an uncompiled .dart
version that can be interpreted by Dartium.
The usual way is that .dart
files are included in the html source with a type of "application/dart"
. Then there's dart.js, which replaces those .dart
files with the corresponding .js
version if the browser doesn't understand Dart, replacding foo.dart
with foo.dart.js
.
My problem is, that the asset pipeline is serving the compiled JavaScript version, even if the client requests foo.dart
. foo.dart
should serve the original, uncompiled version, only foo.dart.js
should be compiled.
Source for ruby-dart and dart-rails
Edit: I thought about just copying the raw .dart
files to the public folder, but that's not an option, since the source file that is seen by the Asset Pipeline might include other .dart
files, which are then compiled into one single .js
file. So, not all .dart
files would be copied.