Skip to content

Commit

Permalink
build: build cordova.js during npm prepare
Browse files Browse the repository at this point in the history
  • Loading branch information
raphinesse committed Jul 14, 2021
1 parent adc380c commit bafb62a
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 4,114 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ example
/framework/libs
/framework/javadoc-public
/framework/javadoc-private

**/assets/www/cordova.js

/test/.externalNativeBuild

/test/androidx/gradle
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ coverage
test
spec
framework/build
cordova-js-src
4 changes: 0 additions & 4 deletions lib/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ function copyJsAndLibrary (projectPath, shared, projectName, targetAPI) {
fs.ensureDirSync(platform_www);
fs.copySync(srcCordovaJsPath, path.join(platform_www, 'cordova.js'));

// Copy cordova-js-src directory into platform_www directory.
// We need these files to build cordova.js if using browserify method.
fs.copySync(path.join(ROOT, 'cordova-js-src'), path.join(platform_www, 'cordova-js-src'));

if (shared) {
var relativeFrameworkPath = path.relative(projectPath, getFrameworkDir(projectPath, true));
fs.symlinkSync(relativeFrameworkPath, nestedCordovaLibPath, 'dir');
Expand Down
81 changes: 81 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"apache"
],
"scripts": {
"prepare": "cordova-js build > templates/project/assets/www/cordova.js",
"test": "npm run lint && npm run cover && npm run java-unit-tests",
"lint": "eslint lib spec test \"templates/cordova/**/!(*.*)\"",
"unit-tests": "jasmine --config=spec/unit/jasmine.json",
Expand All @@ -36,6 +37,7 @@
},
"devDependencies": {
"@cordova/eslint-config": "^3.0.0",
"cordova-js": "^6.1.0",
"jasmine": "^3.7.0",
"jasmine-spec-reporter": "^7.0.0",
"nyc": "^15.1.0",
Expand Down

0 comments on commit bafb62a

Please sign in to comment.