-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Labels
Description
Looking at how cordova-serve is used in this package, I'd question if it would make more sense to drop this dependency entirely.
cordova-serve is not updated regularly and there could be better or modern alternatives for serving web content.
By moving away from this dependency, you'd gain:
- Finer control over the serving logic and choosing which dependencies you prefer to provide.
- Regular updates for the actual seving npm packages.
- Reduced footprint by only including the code that's actually needed.
Possible Approach
This package could replace cordova-serve with a minimal setup by:
-
Installing dependencies that was used in
cordova-serve:express@4.21.2compression@1.8.1open@8.4.2
-
Creating its own
expressapp with just the necessary functionality.
The only logic that would need to be copied from cordova-serve is:
- This entire file: https://github.com/apache/cordova-serve/blob/master/src/util.js
findProjectRootfrom https://github.com/apache/cordova-serve/blob/master/src/platform.js#L56-L66
Proof of Concept
I had created a test branch to confirm the above approach but wanted to get your opinion if you find this beneficial.
EzioLi01