Skip to content

Commit f018d5f

Browse files
Webpack / bundling tip
1 parent a5c841c commit f018d5f

File tree

3 files changed

+20
-39
lines changed

3 files changed

+20
-39
lines changed

.travis.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ matrix:
44
language: node_js
55
os: linux
66
node_js: "8"
7-
script: cd src && npm run ci.tslint && cd ../demo && npm run ci.tslint
8-
- stage: "WebPack, Build and Test"
7+
script: cd src && npm run ci.tslint
8+
- stage: "WebPack, Build"
99
os: osx
1010
env:
1111
- WebPack="iOS"
1212
osx_image: xcode10.0
13-
language: node_js
13+
language: node_js
1414
node_js: "8"
1515
jdk: oraclejdk8
1616
script: cd demo && npm run build.plugin && npm i && tns build ios --bundle --env.uglify
@@ -22,41 +22,23 @@ matrix:
2222
before_install: nvm install 8
2323
script: cd demo && npm run build.plugin && npm i && tns build android --bundle --env.uglify --env.snapshot
2424
- language: android
25-
env:
25+
env:
2626
- BuildAndroid="28"
2727
os: linux
2828
jdk: oraclejdk8
2929
before_install: nvm install stable
3030
script:
3131
- cd src && npm i && npm run tsc && cd ../demo && tns build android
3232
- os: osx
33-
env:
33+
env:
3434
- BuildiOS="12"
3535
- Xcode="10.0"
3636
osx_image: xcode10.0
37-
language: node_js
38-
node_js: "8"
39-
jdk: oraclejdk8
40-
script:
41-
- cd src && npm i && npm run tsc && cd ../demo && tns build ios
42-
- os: linux
43-
language: android
44-
dist: precise
45-
sudo: required
46-
jdk: oraclejdk8
47-
before_script:
48-
- echo no | android create avd --force -n test -t android-21 -b armeabi-v7a
49-
- emulator -avd test -no-audio -no-window &
50-
- android-wait-for-emulator
51-
before_install:
52-
- nvm install 8
53-
script: cd src && npm run test.android
54-
- os: osx
5537
language: node_js
5638
node_js: "8"
5739
jdk: oraclejdk8
58-
osx_image: xcode10.0
59-
script: cd src && npm run test.ios
40+
script:
41+
- cd src && npm i && npm run tsc && cd ../demo && tns build ios
6042

6143
android:
6244
components:
@@ -68,10 +50,10 @@ android:
6850
- sys-img-armeabi-v7a-android-21
6951

7052
before_install:
71-
- sudo pip install --upgrade pip
72-
- sudo pip install six
53+
- sudo pip install --upgrade pip
54+
- sudo pip install six
7355

7456
install:
75-
- echo no | npm install -g nativescript
76-
- tns usage-reporting disable
77-
- tns error-reporting disable
57+
- echo no | npm install -g nativescript
58+
- tns usage-reporting disable
59+
- tns error-reporting disable

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ Easily integrate the most reliable native networking libraries with the latest a
2727
- Transparent GZIP
2828
- HTTP/2 support
2929

30-
## Libraries
31-
iOS | Android
32-
-------- | ---------
33-
[AFNetworking](https://github.com/AFNetworking/AFNetworking) | [okhttp3](https://github.com/square/okhttp)
34-
3530
## FAQ
3631
> What the flip is SSL pinning and all this security mumbo jumbo?
3732
@@ -43,7 +38,7 @@ iOS | Android
4338

4439
## Demo
4540
```shell
46-
git clone https://github.com/gethuman/nativescript-https
41+
git clone https://github.com/EddyVerbruggen/nativescript-https
4742
cd nativescript-https/src
4843
npm run demo.ios
4944
npm run demo.android
@@ -116,6 +111,10 @@ Option | Description
116111
`allowInvalidCertificates?: boolean` | Default: `false`. This should **always** be `false` if you are using SSL pinning. Set this to `true` if you're using a self-signed certificate.
117112
`validatesDomainName?: boolean` | Default: `true`. Determines if the domain name should be validated with your pinned certificate.
118113

114+
## Webpack / bundling
115+
Since you're probably shipping a certificate with your app (like [our demo does](https://github.com/EddyVerbruggen/nativescript-https/tree/master/demo/app/assets)),
116+
make sure it's bundled by Webpack as well. You can do this by [adding the certificate(s) with the `CopyWebpackPlugin`](https://github.com/EddyVerbruggen/nativescript-https/blob/a5c841c0af7ff6d9994fa23f7fba0df0514c58f1/demo/webpack.config.js#L240).
117+
119118
## `iOS` Troubleshooting
120119
> ### Please educate yourself on iOS's [App Transport Security](https://github.com/codepath/ios_guides/wiki/App-Transport-Security) before starting beef!
121120

src/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
},
1313
"scripts": {
1414
"tsc": "tsc -skipLibCheck",
15-
"build": "npm run tsc",
15+
"build": "npm i && npm run tsc",
1616
"postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && npx rimraf -- package-lock.json && cd ../src",
1717
"test.android": "npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch",
1818
"test.ios": "npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch",
1919
"tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude '**/node_modules/**' --exclude '**/typings/**'",
2020
"plugin.tscwatch": "npm run tsc -- -w",
21-
"demo.ios": "npm run tsc && cd ../demo && tns run ios --syncAllFiles",
22-
"demo.android": "npm run tsc && cd ../demo && tns run android --syncAllFiles",
21+
"demo.ios": "npm run build && cd ../demo && tns run ios",
22+
"demo.android": "npm run build && cd ../demo && tns run android",
2323
"demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json",
2424
"plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-https && tns plugin add ../src",
2525
"clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i",

0 commit comments

Comments
 (0)