Skip to content

Commit

Permalink
build(root): browser 指定 umd 构建
Browse files Browse the repository at this point in the history
  • Loading branch information
suanmei committed Jun 30, 2020
1 parent d91d8c6 commit fe7a9b7
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 84 deletions.
4 changes: 1 addition & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ node_modules
.eslintcache

example
screenshots
sources
index.js
src
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"callapp-lib": "^2.1.8",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1",
Expand Down
38 changes: 37 additions & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,44 @@
import React from 'react';
import CallApp from 'callapp-lib';
import './App.css';

const option = {
scheme: {
protocol: 'ykshortvideo',
},
outChain: {
protocol: 'ykshortvideo',
path: 'temporary',
key: 'url',
},
intent: {
package: 'com.youku.shortvideo',
scheme: 'ykshortvideo',
},
universal: {
host: 'flash-link.youku.com',
pathKey: 'action',
},
appstore: 'https://itunes.apple.com/cn/app/id1383186862',
yingyongbao: '//a.app.qq.com/o/simple.jsp?pkgname=com.youku.shortvideo',
fallback: 'https://dianliu.youku.com/service/download',
timeout: 2000,
};

const lib = new CallApp(option);

function App() {
return <div className="App">333</div>;
return (
<div className="App">
<button
onClick={() => {
lib.open({ path: '' });
}}
>
点击唤端
</button>
</div>
);
}

export default App;
5 changes: 5 additions & 0 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2703,6 +2703,11 @@ call-me-maybe@^1.0.1:
resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b"
integrity sha1-JtII6onje1y95gJQoV8DHBak1ms=

callapp-lib@^2.1.8:
version "2.1.8"
resolved "https://registry.yarnpkg.com/callapp-lib/-/callapp-lib-2.1.8.tgz#a8d4003a7ff63462d598e3f6a360302fcb361df2"
integrity sha512-9FUmTz0LCCF43LhiMEN3CJ4RuLGppu8hOn0u9UzUFyd7TU7AXW82Zc9qTq4Mfes36yOGqNYO1v8DJdkQY7+7rA==

caller-callsite@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134"
Expand Down
77 changes: 0 additions & 77 deletions exxxxxxx/index.html

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "callapp-lib",
"version": "2.1.8",
"version": "3.0.0",
"description": "call native webview from webpage",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"browser": "dist/index.iife.js",
"browser": "dist/index.umd.js",
"types": "dist/type/index.d.ts",
"directories": {
"dist": "dist"
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
},
{
file: pkg.browser,
format: 'iife',
format: 'umd',
name: 'CallApp',
},
],
Expand Down

0 comments on commit fe7a9b7

Please sign in to comment.