You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "breautek (via GitHub)" <gi...@apache.org> on 2023/07/31 13:26:16 UTC

[GitHub] [cordova-ios] breautek commented on pull request #1203: refactor!: do not copy JS lib to platform project

breautek commented on PR #1203:
URL: https://github.com/apache/cordova-ios/pull/1203#issuecomment-1658370448

   > @erisu Hi! Could you please tell me how to change from old method of getting /cordova/lib/projectFile.js to new one? Here is code: `// try cordova 7.0 structure` `const IosPlatformApi = require( path.join( iosPlatformPath(), "/cordova/Api" ) );` `const projectFileApi = require( path.join( iosPlatformPath(), "/cordova/lib/projectFile.js" ) );` `const locations = ( new IosPlatformApi() ).locations;` `projectFile = projectFileApi.parse( locations );`
   
   the lib files remain inside `node_modules` now, instead of being copied into the ios xcode project.
   
   `projectFile.js` is not exposed in a public way, so if you need it, it would be great to learn why and maybe in the future we can add a public interface into it.
   
   A hacky way getting access to `projectFile.js` is to simply require it: `require('cordova-ios/lib/projectFile.js')`.
   
   Note the old way that you posted might still be required if you intend to support cordova-ios 6 and earlier. [Here](https://github.com/kelvinhokk/cordova-plugin-localization-strings/pull/85/files) is an example of how this plugin does it to support both versions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org