Before starting to migrate your PhoneGap projects into Monaca, there are some key differences between PhoneGap and Monaca projects. Please read them through in order to have a seamless migration.
File and folder structure of Monaca and PhoneGap project are quite different. Please see the following examples of PhoneGap and Monaca projects:
Project ├── config.xml ├── hooks ├── platforms ├── plugins └── www ├── css ├── img ├── index.html ├── js ├── res │ ├── icon │ └── screen ├── spec └── spec.html
Project ├── config.xml ├── package.json ├── plugins ├── res │ ├── android │ ├── ios │ └── winrt └── www ├── components ├── css └── index.html
The main differences are
res folder location and
In Monaca project, the default
res folder is stored in the root folder. But your project’s config.xml attributes
src is set correctly, the default
res folder is not used.
package.json file is required and used for managing Cordova plugins.
Because of these differences, when importing a PhoneGap project into Monaca, some files and folders will be changed but don’t worry. We will help you adjusting these changes as easy as possible.
Before getting started with the migration, you may want to know about the supported Cordova version and build environment in Monaca.
All newly created projects in Monaca will be using the latest supported Cordova version (currently, Cordova 7.1) by default. If you want to use a lower version, please contact us.
|Cordova||Android platform||iOS platform||Windows platform|
For more information on build environment for lower Cordova version, pleaser refer to Build Environment.
When migrating a project into Monaca, there are a few things you should be aware of such as:
In Monaca, Cordova plugins are managed by
package.json file. If your plugin information is defined in
config.xml file, you will need to import them again into Monaca. Please refer to Import Cordova Plugins.
Store-version Monaca Debugger (found in Google play or AppStore) only includes Core Cordova plugins. If your project contains any third-party Cordova plugins besides the Core Cordova plugins, you will need to build custom debugger to test this kind of project. Custom debugger will only include the plugins used in the project. Please refer to:
Please note that
loader.js file is also loaded
cordova.js file. Therefore, if you are going to include the above lines, you can remove this line: