How to deploy a Polymer dart application

2.4k views Asked by At

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?

2

There are 2 answers

7
Seth Ladd On

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.

0
Andreas Mager On

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));
}