alinz / react-native-webview-bridge

React Native Webview with Javascript Bridge
MIT License
1.37k stars 491 forks source link

Force HTML & JS refresh #188

Open emitchel opened 7 years ago

emitchel commented 7 years ago

Am currently working on a project that uses a webview that carries a heavy (arguably too heavy) load of JS and HTML. When I'm making JS & HTML changes I'm forced to completely uninstall the app to see the newest changes. Is there a way to ignore cached (?) version and always pull from directory? The HTML & JS used is pulled in locally - none of them are pulled over http.


<WebViewBridge
        ref="webviewbridge"
        onBridgeMessage={this.onBridgeMessage.bind(this)}
        source={require("../../webview/my_project.html")}/>```
Etheryte commented 7 years ago

The problem probably stems from using the CommonJS require. While I'm not too familiar with it myself, the module loader has an internal cache and is intended either for static files or JS modules in RN, I'm not sure how it handles loading arbitrary files like this.