bug: www folder is missing with ionic react app using cordova plugin
See original GitHub issueIonic version: ionic 4.0
Current behavior:
I am trying to create a ionic react app, using my custom cordova plugin. I use https://ionicframework.com/blog/ionic-cli-v5-brings-react-beta-support/ to create the app. After adding cordova plugin and running ionic build/cordova prepare for ios the www folder is empty. compared to ionic react app, if i create app for target angular it fills www folder correctly.
Expected behavior: ionic build/cordova prepare should add desired file including index.html to www folder which is not happening fo rreact-ionic app.
Steps to reproduce:
ionic start myApp --type=react
ionic cordova plugin list
ionic cordova plugin add cordova-plugin-custom
=> add cordova dependencies
ionic cordova platform ios
=> add www folder but empty
ionic cordova build ios
ionic cordova prepare ios
=> www folder is still empty
ionic cordova run ios
=> throws an error saying www/index.html not found.
Other information:
If I execute same steps as above except first line as ionic start myApp --type=angular
, it shows www folder correctly including index.html and works fine.
Ionic:
Ionic CLI : 5.0.2 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/react 0.0.5
Cordova:
Cordova CLI : 8.1.1 (cordova-lib@8.1.0) Cordova Platforms : ios 4.5.5 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 4 other plugins)
Utility:
cordova-res : 0.5.1 native-run : 0.2.7
System:
NodeJS : v8.10.0 (/usr/local/bin/node) npm : 6.9.0 OS : macOS Mojave Xcode : Xcode 10.2.1 Build version 10E1001
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
@stubclan - React builds to a
build
directory, not awww
directory, use setwebDir
to that in yourcapacitor.config.json
like this:Not sure I got here (I mean this page) b/c I had the same issue -10mins. ago.
I fixed it by changing
webDir
in ./capacitor.config.json from"www"
to"build"
(to match react build folder)