Maintenance of unrelated asset versions in rails 3.1+

I am currently working on integrating Dart into the Rails Asset Pipeline.

Compilation is already working; .dart files are compiled into .js using the Asset Pipeline. However, there must also be an unrelated version of .dart that can be interpreted by Dartium.

The usual way is that .dart files are included in the html source of type "application/dart" . Then dart.js , which replaces these .dart files with the corresponding version of .js , if the browser does not understand Dart, replacding foo.dart with foo.dart.js

My problem is that the resource pipeline maintains the compiled version of JavaScript, even if the client requests foo.dart . foo.dart should serve as the original, uncompressed version, only foo.dart.js should be compiled.

Source ruby-dart and dart-rails

Change I was thinking of just copying the raw .dart files to a shared folder, but this is not an option, since the source file that is viewed in Asset Pipeline may include other .dart , which are then compiled into one single .js file. Thus, not all .dart files will be copied.

+8
ruby-on-rails dart asset-pipeline
source share
2 answers

you can directly place your .dart files in public / assets /

You should only put the assets you want to pre-process in app / assets / (or vendor / assets / ... etc.). Assets that you do not want to pre-process can be placed directly in public / assets / folder

+1
source share

I wonder if it might be easier to skip the asset pipeline and rely on the Dart editor to compile your JavaScript when you are happy with your code. Sorry, I know this little ghetto.

-one
source share

All Articles