我想離線功能添加到一個角鏢項目,運行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 –
文章顯示添加依賴項會自動生成所需的文件,但它不會,即使在手動添加示例幫助後也會引發相同的錯誤。 –