Skip to content

Commit 35f0d07

Browse files
authored
build: build cordova.js during npm prepare (apache#1271)
1 parent b94409f commit 35f0d07

File tree

8 files changed

+92
-4114
lines changed

8 files changed

+92
-4114
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ example
2525
/framework/libs
2626
/framework/javadoc-public
2727
/framework/javadoc-private
28+
29+
**/assets/www/cordova.js
30+
2831
/test/.externalNativeBuild
2932

3033
/test/androidx/gradle

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ coverage
33
test
44
spec
55
framework/build
6+
cordova-js-src

lib/create.js

-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ function copyJsAndLibrary (projectPath, shared, projectName, targetAPI) {
5656
fs.ensureDirSync(platform_www);
5757
fs.copySync(srcCordovaJsPath, path.join(platform_www, 'cordova.js'));
5858

59-
// Copy cordova-js-src directory into platform_www directory.
60-
// We need these files to build cordova.js if using browserify method.
61-
fs.copySync(path.join(ROOT, 'cordova-js-src'), path.join(platform_www, 'cordova-js-src'));
62-
6359
if (shared) {
6460
var relativeFrameworkPath = path.relative(projectPath, getFrameworkDir(projectPath, true));
6561
fs.symlinkSync(relativeFrameworkPath, nestedCordovaLibPath, 'dir');

package-lock.json

+81
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"apache"
1212
],
1313
"scripts": {
14+
"prepare": "cordova-js build > templates/project/assets/www/cordova.js",
1415
"test": "npm run lint && npm run cover && npm run java-unit-tests",
1516
"lint": "eslint lib spec test \"templates/cordova/**/!(*.*)\"",
1617
"unit-tests": "jasmine --config=spec/unit/jasmine.json",
@@ -36,6 +37,7 @@
3637
},
3738
"devDependencies": {
3839
"@cordova/eslint-config": "^3.0.0",
40+
"cordova-js": "^6.1.0",
3941
"jasmine": "^3.7.0",
4042
"jasmine-spec-reporter": "^7.0.0",
4143
"nyc": "^15.1.0",

0 commit comments

Comments
 (0)