Unable to load local files in WebView
hraynaud opened this issue · 1 comments
hraynaud commented
I am having the same issue described in this github issue. I've described the behavior I'm seeing in that issue and doing so here as well. My comments are at he bottom.
NativeScript/NativeScript#6377
Here is a link to a repo that reproduces the issue:
https://github.com/hraynaud/test-app
I've tried to put my html file in multiple places and it simply doesn't work. Everything I've read suggest that it should work on the simulator and in preview on my device.
Thanks for your help.
hraynaud commented
I was able to get help on from @rigor789 on slack. I needed add my html paths to the copy plugin in webpack.
new CopyWebpackPlugin([
{ from: { glob: "fonts/**" } },
{ from: { glob: "www/*.html" } },
{ from: { glob: "**/*.+(jpg|png)" } },
{ from: { glob: "assets/**/*" } },
], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
new n
This worked for me for loading files from the /app/www/ folder of my application.