React Mobile Apps
React support has been tested with apps from Create React App, but these steps should apply to any webpack application.
Note: In order for Cordova and Cordova plugins to be accessible during corber start and corber serve, corber-webpack-plugin must be added to the Webpack development config which requires the Create React App to be ejected.
- Open
package.json. - Update
homepageto remove its leading slash, if it has one. (set it to a period “.” if has not been set.) - Run
npm run eject. (See note above.) - Open
config/webpack.config.dev.js. - Require
corber-webpack-pluginand assign it asCorberWebpackPlugin. - Add
new CorberWebpackPlugin()to the plugins array.
+const CorberWebpackPlugin = require('corber-webpack-plugin');
module.exports = {
...
plugins: [
+ new CorberWebpackPlugin(),
...
]
...
}
Next: