Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy a Polymer dart application

I have a dart application using Polymer.dart, i replace the dart.js file by the boot.js (in my index.html), an now i want to deploy this application in order to have a working javascript one.

But, when i launch the build.dart, i have :

Total time spent on web/index.html                           -- 504 ms
Total time                                                   -- 555 ms

but nothing is created, no more "out" folder. And when I do Pub Deploy, it create a "deploy" folder, but that version is not working (because the build.dart doesn't properly work i think).

Have you any idea?

like image 415
user2705377 Avatar asked Aug 24 '13 14:08

user2705377


2 Answers

Right now, it's a two step process. I suspect this will get easier. In the meantime:

Create a build.dart that looks like this:

import 'package:polymer/builder.dart';
main() {
  build(entryPoints: ['web/index.html'], options: parseOptions(['--deploy']));
}

Take note, currently, a lot of warnings and hints are produced. You can ignore them for right now.

like image 62
Seth Ladd Avatar answered Nov 12 '22 07:11

Seth Ladd


For the current version i have done these steps :

type on your console: dart build.dart --deploy dart2js out/web/index.html_bootstrap.dart -oout/web/index.html_bootstrap.dart.js

index.html:

<!DOCTYPE html>
<html>
  <head>
    ...    
    <link rel="import" href="clickcounter.html">

    <script type="application/dart">export 'package:polymer/init.dart';</script>
    <script src="packages/browser/dart.js"></script>
  </head>
  <body>
    ... 
    <div id="sample_container_id">
      <click-counter count="5"></click-counter>
    </div>
  </body>
</html>

build.dart:

import 'package:polymer/builder.dart';   
main(args) {
  build(entryPoints: ['web/aaa.html'],
    options: parseOptions(args));
}
like image 1
Andreas Mager Avatar answered Nov 12 '22 07:11

Andreas Mager