You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/11/16 13:16:12 UTC

[GitHub] [cordova-ios] raphinesse commented on a change in pull request #1197: build: build cordova.js during npm prepare

raphinesse commented on a change in pull request #1197:
URL: https://github.com/apache/cordova-ios/pull/1197#discussion_r750260037



##########
File path: package.json
##########
@@ -39,6 +40,7 @@
   },
   "dependencies": {
     "cordova-common": "^4.0.2",
+    "cordova-js": "^6.1.0",

Review comment:
       Shouldn't this be a `devDependency`?

##########
File path: bin/lib/create.js
##########
@@ -25,9 +25,10 @@ const { CordovaError, events } = require('cordova-common');
 const utils = require('./utils');
 
 function copyJsAndCordovaLib (projectPath, projectName, use_shared) {
-    fs.copySync(path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'www/cordova.js'));
-    fs.copySync(path.join(ROOT, 'cordova-js-src'), path.join(projectPath, 'platform_www/cordova-js-src'));
-    fs.copySync(path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'platform_www/cordova.js'));
+    const srcCordovaJsPath = path.join(projectPath, 'www/cordova.js');
+    const platformWwwDir = path.join(projectPath, 'platform_www');
+    fs.ensureDirSync(platformWwwDir);
+    fs.copySync(srcCordovaJsPath, path.join(platformWwwDir, 'cordova.js'));

Review comment:
       Since `fs.copySync ` creates missing target directories, the following should suffice:
   ```suggestion
       fs.copySync(
           path.join(projectPath, 'www/cordova.js'),
           path.join(projectPath, 'platform_www/cordova.js')
       );
   ```




-- 
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