Skip to content

Commit b568ac3

Browse files
authored
fix(ng): Ivy support (#236)
* fix(ng): Ivy support Fixes https://github.com/ionic-team/cordova-plugin-ionic/issues/235.
1 parent 6309207 commit b568ac3

8 files changed

+32
-8
lines changed

package.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
"types": "dist/index.d.ts",
1313
"description": "Ionic Cordova SDK",
1414
"scripts": {
15-
"apply-dev": "npm run build && ./apply-changes.sh",
16-
"create-dev": "./create-local-app.sh",
15+
"apply-dev": "npm run build && ./scripts/apply-changes.sh",
16+
"create-dev": "./scripts/create-local-app.sh",
1717
"clean": "rimraf dist",
1818
"lint": "tslint --config tslint.json --project tsconfig.json",
1919
"precommit": "npm run lint",
2020
"watch": "tsc -w",
2121
"watch-dev": "watch 'npm run apply-dev' ./www",
22-
"build": "npm run clean && tsc",
22+
"build": "npm run clean && tsc && ngc -p tsconfig.ng.json && ./scripts/ng-prepare.sh",
2323
"sync-plugin-xml": "sync-cordova-xml2 package.json plugin.xml --output=plugin.xml",
24-
"version": "npm run sync-plugin-xml && git add plugin.xml && ./update-plugin-version-code.sh",
24+
"version": "npm run sync-plugin-xml && git add plugin.xml && ./scripts/update-plugin-version-code.sh",
2525
"prepublishOnly": "npm run build",
2626
"test": "echo 'We should really get unit tests running'",
2727
"release": "npm run build && np --any-branch",
@@ -56,6 +56,9 @@
5656
],
5757
"license": "MIT",
5858
"devDependencies": {
59+
"@angular/compiler": "^9.1.1",
60+
"@angular/compiler-cli": "^9.1.1",
61+
"@angular/core": "^7.2.15",
5962
"@types/cordova": "0.0.34",
6063
"jest": "^22.4.3",
6164
"np": "^3.0.4",
@@ -66,8 +69,7 @@
6669
"tslint-ionic-rules": "0.0.14",
6770
"typedoc": "^0.11.1",
6871
"typedoc-plugin-markdown": "^1.1.6",
69-
"watch": "^1.0.2",
70-
"@angular/core": "^7.2.15"
72+
"watch": "^1.0.2"
7173
},
7274
"jest": {
7375
"globals": {
File renamed without changes.
File renamed without changes.

scripts/ng-prepare.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /usr/bin/env bash
2+
3+
cat<<EOF>dist/ngx/package.json
4+
{
5+
"name": "cordova-plugin-ionic",
6+
"main": "ngx/index.js",
7+
"module": "ngx/index.js",
8+
"typings": "ngx/index.d.ts"
9+
}
10+
EOF
File renamed without changes.

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
"dom"
1919
]
2020
},
21-
"include": ["www"]
21+
"include": ["www/common.ts", "www/guards.ts", "www/index.ts"]
2222
}

tsconfig.ng.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "es2015",
5+
"outDir": "dist/ngx",
6+
"rootDir": "www"
7+
},
8+
"include": ["www/ngx/index.ts"],
9+
"angularCompilerOptions": {
10+
"enableIvy": false
11+
}
12+
}

www/ngx/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Injectable } from '@angular/core';
2-
import { DeployClass } from '../';
2+
import { DeployClass } from '../index';
33

44
@Injectable()
55
export class Deploy extends DeployClass { }

0 commit comments

Comments
 (0)