Pergunta

I have a dart web application using polymer. I can successfully run it with Dartium using boot.js. However, my index.html file is actually a Django template in another git repo for the project. Its uses template inheritance, among other things, so its not just a normal HTML file.

My goal is to have a Makefile compile the project on request. Currently, pub deploy will compile all the code, and it will run in non-dart browsers. However, my custom polymer elements do not end up being registered. They all show up as blank. Is this kind of setup even possible, that is, to not have an index.html entry point and build custom polymer elements? I could create a dummy buid.html to satisfy the entry-point requirement, but this seems like a sub-optimal solution.

My current buid.dart looks like:

import 'dart:io';
import 'package:polymer/component_build.dart';
import 'package:polymer/deploy.dart' as deploy;

main() {
  build(new Options().arguments, [])
    .then((_) => deploy.main());
}

and the output:

'package:polymer/component_build.dart': Error: line 68 pos 29: \
    ambiguous reference: 'JSON' is defined in library 'dart:convert' \
    and also in 'dart:io'
          var message = JSON.encode([jsonMessage]);
Foi útil?

Solução

The only way is to provide some HTML file as entry point. It doesn't matter when you use another HTML file in production if it contains the necessary script tags.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top