ionic-team / ionic-team/capacitor

[Feature]: Capacitor config "includePlugins" should support paths.

Open
#8,072 0 comments 0 reactions 0 assignees View on GitHub
triage
Dominant language
TypeScript
Stars
16.7k
Forks
1.3k
Avg merge
3d 15h
Merged PRs (30d)
10

Description

### Description

Currently the `includePlugins` property only supports plugin names. If you pass in a path, the string is parsed incorrectly when it's added to the android & ios projects.

### Platforms

- [x] iOS
- [x] Android
- [ ] Web

### Request or proposed solution

For example, currently in `capcitor.config`:

```
...
includePlugins: [
"./../../node_modules/@capacitor-community/file-opener",
]
...
```

Gets added to the `Podfile` as:

```
pod '._.._..NodeModulesCapacitorCommunityFileOpener', :path => '../../../../node_modules/@capacitor-community/file-opener'
```

When it should be added as::

```
pod 'CapacitorCommunityFileOpener', :path => '../../../../node_modules/@capacitor-community/file-opener'
```

A similar parsing issue is present on android.

Either this is a bug or the includePlugins array was never designed to handle paths.

For mono-repos this would be very useful as the capacitor project is stored in a separate folder as all our node_modules deps.

### Alternatives

For mono-repos that rely on storing node_modules deps separately from a capacitor project, there is another approach detailed here: https://jorgevergara.co/blog/capacitor-monorepo/. However this approach doesn't currently work with some of the newest capacitor plugins as outlined in this bug: https://github.com/ionic-team/capacitor-file-viewer/issues/3.

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.