【发布时间】:2018-08-31 16:07:09
【问题描述】:
我有一个 NativeScript 项目和一个 Angular 项目。我正在创建一个混合应用程序。我使用 WebView 并将 Angular 项目中的所有捆绑文件放入 NativeScript 项目的文件夹中。
在构建 Angular 项目时,我像这样动态重写基本 href
<script>document.write('<base href="' + document.location + '" />');</script>
这是我加载捆绑文件的方式。
let webview: WebView = this.webViewRef.nativeElement;
oWebViewInterface = new webViewInterfaceModule.WebViewInterface(
webview,
'~/www/app/index.html')
这很好用!但是,当我使用 --bundle 并将 Webpack 添加到组合中时,我的基本 href 停止工作,并且我的控制台中出现 FILE NOT FOUND 错误。
新路径在哪里?
【问题讨论】:
标签: angular typescript webpack nativescript