I am trying to change the build path for react-app-rewired in the file config-overrides.json as mentioned here.
module.exports = {
paths: function (paths, env) {
paths.appBuild = 'C:\\Projects\\jhipster\\src\\main\\webapp\\app';
return paths;
}
};
But it is not taken into consideration, and I receive the following error:
Could not find a required file.
Name: index.html
Searched in: C:\Projects\jhipster\public
I have hardcoded the path directly just to test if it's working.
Am I omitting something?
The problem actually isn't related to the build path. The problem is that React expects there to be a public/index.html file but can't find any such file. I'm guessing you've either renamed the public folder or moved index.html somewhere else.
Solution: tell react-app-rewired where to find index.html.
// config-overrides.json
module.exports = {
paths: function (paths, env) {
paths.appBuild = 'C:\\Projects\\jhipster\\src\\main\\webapp\\app';
// Tell the app where our public folder is
paths.appPublic = 'path_to_public_folder';
// Tell the app where our index.html is
paths.appHtml = 'path_to_index.html';
return paths;
}
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With