File and Folder Structure

Cordova version

With different Cordova versions, the file and folder structure of a Monaca project are configured differently.

For Cordova 6.2 and 6.5

File/Folder Name

Description

Storage folder for additional plugins

res/

Resources folder for Android, iOS and Winrt

Storage folder for the main body of the application

Application configuration file

For Cordova 7.1

File/Folder Name

Description

Storage folder for additional plugins

res/

Resources folder for Android, iOS and Winrt

Storage folder for the main body of the application

Application configuration file

package.json

Cordova plugins management file

www folder

Files of the application’s main body are stored here. Files and folders can be arranged freely within the www folder, but the following parts have a special significance:

File/Folder Name

Description

index.html

The first page to be displayed when the application starts up. The startup file can be changed.

The folder created by Monaca for all JS/CSS components used in the project.

Components folder

The folder www/components/ is for all JS/CSS components used in the project. However, the following two files exist in the folder by default regardless of what kinds of components you have added to your project:

File Name

Description

loader.js

A JavaScript file used by Monaca to load JavaScript libraries

loader.css

A style sheet file used by Monaca to load CSS libraries

The loader.js and loader.css files must be read from an HTML file.

Each component will create its own folder in the (one level below) www/components/ folder.loader.js file also loads cordova.js file.

Plugins folder

If you import a Cordova plugin using a ZIP file, it will be stored inside this folder. However, if you import the plugin using package URL/Plugin ID, the plugin file will be downloaded during build.

config.xml file

The config.xml is a file that controls various settings of Cordova. Please refer to the following documentations regarding how to edit the config.xml file for Android and iOS:

For Cordova 6.2 or higher, config.xml file is also used to configure either Android or iOS application settings. Please refer to Cordova Custom Config Plugin.

See Also:

Last updated