Skip to content

Commit fe7a9b7

Browse files
committed
build(root): browser 指定 umd 构建
1 parent d91d8c6 commit fe7a9b7

File tree

7 files changed

+47
-84
lines changed

7 files changed

+47
-84
lines changed

.npmignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ node_modules
33
.eslintcache
44

55
example
6-
screenshots
7-
sources
8-
index.js
6+
src

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"@types/node": "^12.0.0",
1111
"@types/react": "^16.9.0",
1212
"@types/react-dom": "^16.9.0",
13+
"callapp-lib": "^2.1.8",
1314
"react": "^16.13.1",
1415
"react-dom": "^16.13.1",
1516
"react-scripts": "3.4.1",

example/src/App.tsx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,44 @@
11
import React from 'react';
2+
import CallApp from 'callapp-lib';
23
import './App.css';
34

5+
const option = {
6+
scheme: {
7+
protocol: 'ykshortvideo',
8+
},
9+
outChain: {
10+
protocol: 'ykshortvideo',
11+
path: 'temporary',
12+
key: 'url',
13+
},
14+
intent: {
15+
package: 'com.youku.shortvideo',
16+
scheme: 'ykshortvideo',
17+
},
18+
universal: {
19+
host: 'flash-link.youku.com',
20+
pathKey: 'action',
21+
},
22+
appstore: 'https://itunes.apple.com/cn/app/id1383186862',
23+
yingyongbao: '//a.app.qq.com/o/simple.jsp?pkgname=com.youku.shortvideo',
24+
fallback: 'https://dianliu.youku.com/service/download',
25+
timeout: 2000,
26+
};
27+
28+
const lib = new CallApp(option);
29+
430
function App() {
5-
return <div className="App">333</div>;
31+
return (
32+
<div className="App">
33+
<button
34+
onClick={() => {
35+
lib.open({ path: '' });
36+
}}
37+
>
38+
点击唤端
39+
</button>
40+
</div>
41+
);
642
}
743

844
export default App;

example/yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2703,6 +2703,11 @@ call-me-maybe@^1.0.1:
27032703
resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b"
27042704
integrity sha1-JtII6onje1y95gJQoV8DHBak1ms=
27052705

2706+
callapp-lib@^2.1.8:
2707+
version "2.1.8"
2708+
resolved "https://registry.yarnpkg.com/callapp-lib/-/callapp-lib-2.1.8.tgz#a8d4003a7ff63462d598e3f6a360302fcb361df2"
2709+
integrity sha512-9FUmTz0LCCF43LhiMEN3CJ4RuLGppu8hOn0u9UzUFyd7TU7AXW82Zc9qTq4Mfes36yOGqNYO1v8DJdkQY7+7rA==
2710+
27062711
caller-callsite@^2.0.0:
27072712
version "2.0.0"
27082713
resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134"

exxxxxxx/index.html

Lines changed: 0 additions & 77 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "callapp-lib",
3-
"version": "2.1.8",
3+
"version": "3.0.0",
44
"description": "call native webview from webpage",
55
"main": "dist/index.cjs.js",
66
"module": "dist/index.esm.js",
7-
"browser": "dist/index.iife.js",
7+
"browser": "dist/index.umd.js",
88
"types": "dist/type/index.d.ts",
99
"directories": {
1010
"dist": "dist"

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default {
1919
},
2020
{
2121
file: pkg.browser,
22-
format: 'iife',
22+
format: 'umd',
2323
name: 'CallApp',
2424
},
2525
],

0 commit comments

Comments
 (0)