after reading article found @ https://www.dartlang.org/articles/web-ui/tools.html, tried compile application following it.
my application stored in web/app.html can compiled javascript under darteditor using "run javascript" command.
when try use following command lines perform compilation deploying in production, encounter issue on uncopied package part file.
$ dart --package-root=packages/ packages/web_ui/dwc.dart --out /tmp/dart/ --no-rewrite-urls web/app.html $ ls lib/app/ model_browser.dart model_server.dart $ ls lib/app/src/model/ model_browser.dart model_server.dart model_shared.dart $ cd /tmp/dart $ dart2js -v app.html_bootstrap.dart --package-root=packages/ -oapp.html_bootstrap.dart.js ... info: scanning library file:///private/tmp/dart/_from_packages/bm/model_browser.dart _from_packages/app/model_browser.dart:12:1: error: cannot read "_from_packages/app/src/model/model_shared.dart" (os error: no such file or directory, errno = 2). part 'src/model/model_shared.dart'; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ info: error: compiler cancelled: error: cannot read "_from_packages/app/src/model/model_shared.dart" (os error: no such file or directory, errno = 2). ... $ ls _from_packages/app/ model_browser.dart model_browser.dart.map $ ls _from_packages/app/src/model/ model_browser.dart model_browser.dart.map
in fact, "model_shared.dart" file isn't copied /tmp/dart/_from_packages/app/src/model/model_shared.dart. content of model_browser.dart following
library model; import 'dart:json' json; import 'package:bm/i18n.dart' i18n; import 'package:logging/logging.dart'; import 'package:web_ui/web_ui.dart'; part 'src/model/model_shared.dart'; part 'src/model/model_browser.dart';
darteditor can launch application javascript. right command line launching dart2js in order take account "part" statements of "model" library ?
the issue linked "--no-rewrite-urls" option , absolute path in --out option. if remove "--no-rewrite-urls" option , put relative path in --out option, dart2js compilation done.
Comments
Post a Comment