我想离线功能添加到一个角镖项目,运行pub build
但PWA工人投用AngularDart
Running pub build:pub.exe build
-----
Unhandled exception:
ProcessException: The system cannot find the file specified.
Command: pub.exe build
#0 _buildProjectIfEmptyOrOld (http://localhost:52940/pwa.dart:116)
<asynchronous suspension>
#1 main (http://localhost:52940/pwa.dart:40)
<asynchronous suspension>
#2 _startIsolate.<anonymous closure> (dart:isolate-
patch/isolate_patch.dart:263)
#3 _RawReceivePortImpl._handleMessage (dart:isolate-
patch/isolate_patch.dart:151)
main.dart
import 'package:angular/angular.dart';
import 'package:my_app/views/app_component/app_component.dart';
import 'package:pwa/client.dart' as pwa;
void main() {
bootstrap(AppComponent);
// register PWA ServiceWorker for offline caching.
new pwa.Client();
}
pubspec.yaml
dependencies:
pwa: ^0.1.2
你把“pwa.dart”文件放在哪里?您是否检查了示例https://github.com/isoos/pwa/tree/master/examples? –
根据文章,我试图知道如何做到这一点,链接:http://news.dartlang.org/2017/03/making-dart-web-app-offline-capable-3.html –
文章显示添加依赖项会自动生成所需的文件,但它不会,即使在手动添加示例帮助后也会引发相同的错误。 –