apache / apache/cordova

(improvement) Do not require the www-folder to detect a Cordova-based project.

Open
#155 6 comments 4 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
No language data
Stars
710
Forks
75
PR merge metrics
No merged PRs in 30d

Description

# Improvement (Bug? Feature Request?)

Currently Cordova requires the file `config.xml` and the `www` folder to detect a Cordova-based project.

The need of the www-folder is not necessary. It does not matter if it is empty or not. And Cordova will not touch it. (e.g. for installing a native plugin). Cordova is just happy if the www-folder is there.

It's annoying if the www-folder is the dist (build) folder and not tracked by git.
In this case I have to add a `.gitkeep` file and ignore all other files inside for git.
To always keep it.

If you try to install a plugin without the www-folder, you'll get the error:

```text
cordova plugin add cordova-plugin-inappbrowser --verbose
Current working directory is not a Cordova-based project.
```

Expected behavior:
Only detect the Cordova-based project by the config.xml.

Q: Why? The www-folder is the source Folder for Cordova!

A: Well, it is used to build the apk. But If you use frameworks like Ionic / Angular you have another source base (src-folder) and build to the www-folder to finally pack it to the apk with Cordova.
And the www-folder is not a part of the git-repository.

What do you think? Can we do without the www-folder? It's just a dummy in this case.

Cordvoa Version `9.0.0`

### Workaround

**.gitignore**
```
www/*
!www/.gitkeep
```

Add a **.gitkeep** file to the www-folder.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.