Webpack & WebView html file not found err


#1

I have an issue with the latest
tns using tns run android --bundle

Got runtime error that webview.html file is not found, but everything works fine without bundling.

Err:
JS: Error loading file:///data/data/org.nativescript.BTrex/files/app/webview.html: net::ERR_FILE_NOT_FOUND(-1)

I define the input file like that:

 const webView: WebView = this.webView.nativeElement;
 this.oWebViewInterface = new webViewInterfaceModule.WebViewInterface(webView, '~/webview.html');

Does anyone know what’s the work around for that?
Shall i manulally copy the webview.html file from the /app location to respective folder in with webpack copy plugin?


#2

Webpack wouldn’t know you are using those html files until you tell it. Follow the instructions here.

https://docs.nativescript.org/best-practices/bundling-with-webpack#bundling-extra-assets