A Cordova project created via the CLI follows a specific directory structure. Understanding these directories is critical for managing assets, configuration, and version control.
Default Structure
myapp/
├── config.xml
├── node_modules/
├── package.json
├── platforms/
├── plugins/
└── www
Core Directories
www/: The primary location for your web assets (HTML, CSS, JavaScript, images). Always edit files here. These files are automatically copied to each platform's directory during cordova prepare.config.xml: The main configuration file for your application. Use this to define preferences and customize project behavior.package.json: A manifest of your project's JavaScript dependencies (Cordova, platforms, and plugins) and plugin variable values.platforms/: Contains the source code and build scripts for added platforms (e.g., Android, iOS). Warning: Do not edit files here directly; they are routinely overwritten by the CLI.plugins/: A staging area where installed plugins are copied before being applied to platforms. Do not commit this to version control.node_modules/: Contains npm dependency packages for Cordova and your project. This is the unedited source of truth; do not edit files here.
myapp/
├── config.xml
├── node_modules/
├── package.json
├── platforms/
├── plugins/
└── www