cordova icon indicating copy to clipboard operation
cordova copied to clipboard

Installing a plugin with --link does not links the javascript file.

Open distante opened this issue 6 years ago • 3 comments

Bug Report

Problem

When developing a plugin, if the plugin is installed using the --link flag each change in the source Java File is applied to the plugin on next build (the file is a symlink). The same does not happens with the JavasSript file.

What is expected to happen?

Te JavaScript file should also be somehow linked

What does actually happen?

An old javascript file lives in platforms\android\platform_www\plugins\cordova-plugin-some-name\www\SomePlugin.js

Information

As work around I use a script that appends de cordova wrapper to my javascript file and copy it.

Command or Code

cordova install some-plugin --link

Environment, Platform, Device

Tested in Windows 10 with 9.0.0 ([email protected])

Version information

Checklist

  • [x] I searched for existing GitHub issues
  • [x] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

distante avatar Sep 26 '19 19:09 distante

A minimal, reproducible example is needed.

brody4hire avatar Dec 30 '19 19:12 brody4hire

+1 on this feature request. The requestor is asking for the ability to edit (say, within Xcode) the plugin's www/JS linked files, not just source/header files (e.g., .h, .swift, etc...).

Perhaps this has not been possible because the JavaScript gets modified by Cordova when it is pulled in to the final project.

mtamburro avatar Aug 21 '20 21:08 mtamburro

Yes this is more a feature request than a bug, I'm pretty sure linking js files was something that was never supported.

Perhaps this has not been possible because the JavaScript gets modified by Cordova when it is pulled in to the final project.

I'm pretty sure this is the case, because we copy the JS file contents and insert it into another js file wrapped in a function, or something to that effect. This comes from ancient times before there were better bundling tools. We could consider using something such as rollup instead, and that may allow us to allow linking to js files and other assets. This was discussed at some point before but I couldn't find the email thread.

breautek avatar Aug 29 '20 00:08 breautek