I'm trying to build an app using Webpack and Cordova. I put the contents of my webpack 'dist' folder into my cordova 'www' folder and then I build it for Android and emulate it.
When the app opens I get a lot of 'ERR_FILE_NOT_FOUND' erros, when I open my compiled index.html I see that there is a '/' in front of every link that causes the error because it points to the wrong directory.
Example 'src=/static/js/example.js'
If I remove the first '/' manually and rebuild the app for Android it works.
How do I remove those '/' when I compile my project so I don't have to manually edit every link after compiling?
Example:
It should look for the files in the same folder as the index.html: "file:///android_asset/www/index.html#/"
instead it goes to: 'file:///static/js/example.js'
(The static map is in the same directory as the index.html)
Note: When I open the index.html directly in the browser the links work
publicPath: ''to the webpack config seemed to have resolved the issue!