@xylink/xy-rtc-sdk 3.8.0-beta.6 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +37 -37
- package/lib/action/index.d.ts +67 -38
- package/lib/enum/contraints.d.ts +1 -0
- package/lib/enum/index.d.ts +2 -0
- package/lib/main/client.d.ts +31 -1
- package/lib/main/layoutManager.d.ts +5 -5
- package/lib/main/qualityManager.d.ts +1 -0
- package/lib/main/stream.d.ts +1 -1
- package/lib/tools/queue.d.ts +10 -0
- package/lib/tools/utils.d.ts +2 -1
- package/lib/type/client.d.ts +43 -6
- package/lib/type/index.d.ts +1 -0
- package/lib/type/layout.d.ts +11 -0
- package/lib/xyrtc.cjs.js +1 -1
- package/lib/xyrtc.umd.js +1 -1
- package/package.json +119 -119
- package/public/login.ico +0 -0
- package/scripts/build_lib.js +0 -16
- package/scripts/utils.js +0 -27
- package/scripts/webpack.common.js +0 -139
- package/scripts/webpack.dev.js +0 -27
- package/scripts/webpack.sdk.js +0 -68
- package/tsconfig.lib.json +0 -37
package/package.json
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xylink/xy-rtc-sdk",
|
|
3
|
-
"version": "3.8.0
|
|
4
|
-
"description": "XYLink RTC SDK(小鱼易连WebRTC SDK)",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"XYLink RTC SDK",
|
|
7
|
-
"XYLink WebRTC SDK",
|
|
8
|
-
"WebRTC SDK",
|
|
9
|
-
"RTC SDK"
|
|
10
|
-
],
|
|
11
|
-
"main": "lib/xyrtc.cjs.js",
|
|
12
|
-
"types": "lib/index.d.ts",
|
|
13
|
-
"scripts": {
|
|
14
|
-
"dev": "npm run start",
|
|
15
|
-
"start": "cross-env NODE_ENV=development webpack serve --config ./scripts/webpack.dev.js",
|
|
16
|
-
"build:demo": "cross-env NODE_ENV=production webpack --config ./scripts/webpack.common.js",
|
|
17
|
-
"build:lib": "cross-env NODE_ENV=production webpack --config ./scripts/webpack.sdk.js",
|
|
18
|
-
"build:nodeLib": "node ./scripts/build_lib.js",
|
|
19
|
-
"test": "jest",
|
|
20
|
-
"xytools": "xytools",
|
|
21
|
-
"version:beta": "npm version prerelease --preid=beta",
|
|
22
|
-
"publish:beta": "npm publish --tag beta --access public"
|
|
23
|
-
},
|
|
24
|
-
"author": "jinghui-Luo",
|
|
25
|
-
"email": "luojinghui424@gmail.com",
|
|
26
|
-
"bugs": {
|
|
27
|
-
"url": "https://github.com/xylink-com/xylink-rtc-demo/issues",
|
|
28
|
-
"email": "luojinghui424@gmail.com"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@babel/core": "^7.18.10",
|
|
32
|
-
"@babel/plugin-transform-runtime": "^7.18.10",
|
|
33
|
-
"@babel/preset-env": "^7.18.10",
|
|
34
|
-
"@babel/preset-react": "^7.18.6",
|
|
35
|
-
"@babel/preset-typescript": "^7.7.4",
|
|
36
|
-
"@svgr/webpack": "^6.3.1",
|
|
37
|
-
"@types/clone-deep": "^4.0.1",
|
|
38
|
-
"@types/crypto-js": "^4.0.1",
|
|
39
|
-
"@types/downloadjs": "^1.4.2",
|
|
40
|
-
"@types/react": "^17.0.3",
|
|
41
|
-
"@types/react-dom": "^17.0.6",
|
|
42
|
-
"@types/uuid": "^8.3.0",
|
|
43
|
-
"antd": "4.10.1",
|
|
44
|
-
"axios": "^0.19.1",
|
|
45
|
-
"babel-loader": "^8.2.5",
|
|
46
|
-
"babel-plugin-import": "^1.13.5",
|
|
47
|
-
"clone-deep": "^4.0.1",
|
|
48
|
-
"copy-webpack-plugin": "^11.0.0",
|
|
49
|
-
"core-js": "^3.24.1",
|
|
50
|
-
"cross-env": "^7.0.3",
|
|
51
|
-
"css-loader": "^6.7.1",
|
|
52
|
-
"dexie": "^2.0.4",
|
|
53
|
-
"dexie-export-import": "^1.0.0-rc.1",
|
|
54
|
-
"downloadjs": "^1.4.7",
|
|
55
|
-
"eslint": "^6.7.1",
|
|
56
|
-
"eslint-config-alloy": "^3.4.0",
|
|
57
|
-
"html-webpack-plugin": "^5.5.0",
|
|
58
|
-
"husky": "^4.3.8",
|
|
59
|
-
"jest": "^25.1.0",
|
|
60
|
-
"jszip": "^3.5.0",
|
|
61
|
-
"less": "^4.1.3",
|
|
62
|
-
"less-loader": "^11.0.0",
|
|
63
|
-
"lint-staged": "^10.5.4",
|
|
64
|
-
"mini-css-extract-plugin": "^2.6.1",
|
|
65
|
-
"postcss-loader": "^7.0.1",
|
|
66
|
-
"prettier": "^1.19.1",
|
|
67
|
-
"react": "^16.10.2",
|
|
68
|
-
"react-dom": "^16.10.2",
|
|
69
|
-
"sass": "^1.54.3",
|
|
70
|
-
"sass-loader": "^13.0.2",
|
|
71
|
-
"style-loader": "^3.3.1",
|
|
72
|
-
"terser-webpack-plugin": "^5.3.3",
|
|
73
|
-
"ts-loader": "^9.3.1",
|
|
74
|
-
"typescript": "^4.3.2",
|
|
75
|
-
"validate-commit-msg": "^2.14.0",
|
|
76
|
-
"vconsole": "^3.3.4",
|
|
77
|
-
"webpack": "^5.74.0",
|
|
78
|
-
"webpack-cli": "^4.10.0",
|
|
79
|
-
"webpack-dev-server": "^4.9.3",
|
|
80
|
-
"worker-loader": "^3.0.8",
|
|
81
|
-
"xytools": "^1.5.7"
|
|
82
|
-
},
|
|
83
|
-
"dependencies": {
|
|
84
|
-
"crypto-browserify": "^3.12.0",
|
|
85
|
-
"crypto-js": "^4.1.1",
|
|
86
|
-
"encryptlong": "^3.1.4",
|
|
87
|
-
"js-base64": "^3.6.1",
|
|
88
|
-
"uuid": "^7.0.2"
|
|
89
|
-
},
|
|
90
|
-
"husky": {
|
|
91
|
-
"hooks": {
|
|
92
|
-
"pre-commit": "lint-staged",
|
|
93
|
-
"commit-msg": "validate-commit-msg"
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
"config": {
|
|
97
|
-
"validate-commit-msg": {
|
|
98
|
-
"types": [
|
|
99
|
-
"feat",
|
|
100
|
-
"fix",
|
|
101
|
-
"docs",
|
|
102
|
-
"style",
|
|
103
|
-
"refactor",
|
|
104
|
-
"perf",
|
|
105
|
-
"test",
|
|
106
|
-
"build",
|
|
107
|
-
"ci",
|
|
108
|
-
"chore",
|
|
109
|
-
"revert",
|
|
110
|
-
"merge"
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
"lint-staged": {
|
|
115
|
-
"{src,demo}/**/*.{js,jsx,json,ts,tsx,scss,sass,css,md}": [
|
|
116
|
-
"prettier --write"
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@xylink/xy-rtc-sdk",
|
|
3
|
+
"version": "3.8.0",
|
|
4
|
+
"description": "XYLink RTC SDK(小鱼易连WebRTC SDK)",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"XYLink RTC SDK",
|
|
7
|
+
"XYLink WebRTC SDK",
|
|
8
|
+
"WebRTC SDK",
|
|
9
|
+
"RTC SDK"
|
|
10
|
+
],
|
|
11
|
+
"main": "lib/xyrtc.cjs.js",
|
|
12
|
+
"types": "lib/index.d.ts",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "npm run start",
|
|
15
|
+
"start": "cross-env NODE_ENV=development webpack serve --config ./scripts/webpack.dev.js",
|
|
16
|
+
"build:demo": "cross-env NODE_ENV=production webpack --config ./scripts/webpack.common.js",
|
|
17
|
+
"build:lib": "cross-env NODE_ENV=production webpack --config ./scripts/webpack.sdk.js",
|
|
18
|
+
"build:nodeLib": "node ./scripts/build_lib.js",
|
|
19
|
+
"test": "jest",
|
|
20
|
+
"xytools": "xytools",
|
|
21
|
+
"version:beta": "npm version prerelease --preid=beta",
|
|
22
|
+
"publish:beta": "npm publish --tag beta --access public"
|
|
23
|
+
},
|
|
24
|
+
"author": "jinghui-Luo",
|
|
25
|
+
"email": "luojinghui424@gmail.com",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/xylink-com/xylink-rtc-demo/issues",
|
|
28
|
+
"email": "luojinghui424@gmail.com"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@babel/core": "^7.18.10",
|
|
32
|
+
"@babel/plugin-transform-runtime": "^7.18.10",
|
|
33
|
+
"@babel/preset-env": "^7.18.10",
|
|
34
|
+
"@babel/preset-react": "^7.18.6",
|
|
35
|
+
"@babel/preset-typescript": "^7.7.4",
|
|
36
|
+
"@svgr/webpack": "^6.3.1",
|
|
37
|
+
"@types/clone-deep": "^4.0.1",
|
|
38
|
+
"@types/crypto-js": "^4.0.1",
|
|
39
|
+
"@types/downloadjs": "^1.4.2",
|
|
40
|
+
"@types/react": "^17.0.3",
|
|
41
|
+
"@types/react-dom": "^17.0.6",
|
|
42
|
+
"@types/uuid": "^8.3.0",
|
|
43
|
+
"antd": "4.10.1",
|
|
44
|
+
"axios": "^0.19.1",
|
|
45
|
+
"babel-loader": "^8.2.5",
|
|
46
|
+
"babel-plugin-import": "^1.13.5",
|
|
47
|
+
"clone-deep": "^4.0.1",
|
|
48
|
+
"copy-webpack-plugin": "^11.0.0",
|
|
49
|
+
"core-js": "^3.24.1",
|
|
50
|
+
"cross-env": "^7.0.3",
|
|
51
|
+
"css-loader": "^6.7.1",
|
|
52
|
+
"dexie": "^2.0.4",
|
|
53
|
+
"dexie-export-import": "^1.0.0-rc.1",
|
|
54
|
+
"downloadjs": "^1.4.7",
|
|
55
|
+
"eslint": "^6.7.1",
|
|
56
|
+
"eslint-config-alloy": "^3.4.0",
|
|
57
|
+
"html-webpack-plugin": "^5.5.0",
|
|
58
|
+
"husky": "^4.3.8",
|
|
59
|
+
"jest": "^25.1.0",
|
|
60
|
+
"jszip": "^3.5.0",
|
|
61
|
+
"less": "^4.1.3",
|
|
62
|
+
"less-loader": "^11.0.0",
|
|
63
|
+
"lint-staged": "^10.5.4",
|
|
64
|
+
"mini-css-extract-plugin": "^2.6.1",
|
|
65
|
+
"postcss-loader": "^7.0.1",
|
|
66
|
+
"prettier": "^1.19.1",
|
|
67
|
+
"react": "^16.10.2",
|
|
68
|
+
"react-dom": "^16.10.2",
|
|
69
|
+
"sass": "^1.54.3",
|
|
70
|
+
"sass-loader": "^13.0.2",
|
|
71
|
+
"style-loader": "^3.3.1",
|
|
72
|
+
"terser-webpack-plugin": "^5.3.3",
|
|
73
|
+
"ts-loader": "^9.3.1",
|
|
74
|
+
"typescript": "^4.3.2",
|
|
75
|
+
"validate-commit-msg": "^2.14.0",
|
|
76
|
+
"vconsole": "^3.3.4",
|
|
77
|
+
"webpack": "^5.74.0",
|
|
78
|
+
"webpack-cli": "^4.10.0",
|
|
79
|
+
"webpack-dev-server": "^4.9.3",
|
|
80
|
+
"worker-loader": "^3.0.8",
|
|
81
|
+
"xytools": "^1.5.7"
|
|
82
|
+
},
|
|
83
|
+
"dependencies": {
|
|
84
|
+
"crypto-browserify": "^3.12.0",
|
|
85
|
+
"crypto-js": "^4.1.1",
|
|
86
|
+
"encryptlong": "^3.1.4",
|
|
87
|
+
"js-base64": "^3.6.1",
|
|
88
|
+
"uuid": "^7.0.2"
|
|
89
|
+
},
|
|
90
|
+
"husky": {
|
|
91
|
+
"hooks": {
|
|
92
|
+
"pre-commit": "lint-staged",
|
|
93
|
+
"commit-msg": "validate-commit-msg"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"config": {
|
|
97
|
+
"validate-commit-msg": {
|
|
98
|
+
"types": [
|
|
99
|
+
"feat",
|
|
100
|
+
"fix",
|
|
101
|
+
"docs",
|
|
102
|
+
"style",
|
|
103
|
+
"refactor",
|
|
104
|
+
"perf",
|
|
105
|
+
"test",
|
|
106
|
+
"build",
|
|
107
|
+
"ci",
|
|
108
|
+
"chore",
|
|
109
|
+
"revert",
|
|
110
|
+
"merge"
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"lint-staged": {
|
|
115
|
+
"{src,demo}/**/*.{js,jsx,json,ts,tsx,scss,sass,css,md}": [
|
|
116
|
+
"prettier --write"
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
}
|
package/public/login.ico
DELETED
|
Binary file
|
package/scripts/build_lib.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* XYLink WebRTC SDK Build Npm Script
|
|
3
|
-
*
|
|
4
|
-
* Created at : 2022-08-12 19:11:52
|
|
5
|
-
* Last modified : 2022-08-16 21:01:37
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const shell = require('shelljs');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
const cross = `${path.resolve(__dirname, '../node_modules/cross-env/src/bin/cross-env.js')}`;
|
|
12
|
-
const webpack = `${path.resolve(__dirname, '../node_modules/webpack/bin/webpack.js')}`;
|
|
13
|
-
|
|
14
|
-
shell.exec(`${cross} NODE_ENV=production && ${webpack} --config ./scripts/webpack.sdk.js`, () => {
|
|
15
|
-
console.log('构建包结束');
|
|
16
|
-
});
|
package/scripts/utils.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const currentTime = () => {
|
|
2
|
-
const now = new Date();
|
|
3
|
-
const year = now.getFullYear(); //年
|
|
4
|
-
const month = now.getMonth() + 1; //月
|
|
5
|
-
const day = now.getDate(); //日
|
|
6
|
-
const hh = now.getHours(); //时
|
|
7
|
-
const mm = now.getMinutes(); //分
|
|
8
|
-
let clock = year + '-';
|
|
9
|
-
|
|
10
|
-
if (month < 10) clock += '0';
|
|
11
|
-
clock += month + '-';
|
|
12
|
-
|
|
13
|
-
if (day < 10) clock += '0';
|
|
14
|
-
clock += day + ' ';
|
|
15
|
-
|
|
16
|
-
if (hh < 10) clock += '0';
|
|
17
|
-
clock += hh + ':';
|
|
18
|
-
|
|
19
|
-
if (mm < 10) clock += '0';
|
|
20
|
-
clock += mm;
|
|
21
|
-
|
|
22
|
-
return clock;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
module.exports = {
|
|
26
|
-
currentTime
|
|
27
|
-
};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const webpack = require('webpack');
|
|
3
|
-
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
4
|
-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
5
|
-
const CopyPlugin = require('copy-webpack-plugin');
|
|
6
|
-
const { currentTime } = require('./utils');
|
|
7
|
-
const TerserPlugin = require('terser-webpack-plugin');
|
|
8
|
-
|
|
9
|
-
const version = JSON.stringify(`${require('../package.json').version} - build on ${currentTime()}`);
|
|
10
|
-
const isProduction = !!(process.env.NODE_ENV === 'production');
|
|
11
|
-
|
|
12
|
-
const getStyleLoader = (...restLoader) => {
|
|
13
|
-
const loaders = [];
|
|
14
|
-
|
|
15
|
-
if (isProduction) {
|
|
16
|
-
loaders.push(MiniCssExtractPlugin.loader);
|
|
17
|
-
} else {
|
|
18
|
-
loaders.push('style-loader');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
loaders.push('css-loader');
|
|
22
|
-
|
|
23
|
-
restLoader.forEach((item) => {
|
|
24
|
-
loaders.push(item);
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
return loaders;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
module.exports = {
|
|
31
|
-
entry: './demo/index.tsx',
|
|
32
|
-
output: {
|
|
33
|
-
filename: 'xyrtc.[name].js',
|
|
34
|
-
chunkFilename: 'xyrtc_[name].js',
|
|
35
|
-
path: path.resolve(__dirname, '../build'),
|
|
36
|
-
clean: true
|
|
37
|
-
},
|
|
38
|
-
mode: isProduction ? 'production' : 'development',
|
|
39
|
-
devtool: false,
|
|
40
|
-
resolve: {
|
|
41
|
-
extensions: ['.tsx', '.ts', '.js', '.jsx'],
|
|
42
|
-
alias: {
|
|
43
|
-
'@': path.resolve(__dirname, '../demo'),
|
|
44
|
-
'@xylink/xy-rtc-sdk': path.resolve(__dirname, '../src/index.ts')
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
externals: {},
|
|
48
|
-
optimization: {
|
|
49
|
-
moduleIds: 'deterministic',
|
|
50
|
-
runtimeChunk: 'single',
|
|
51
|
-
splitChunks: {
|
|
52
|
-
chunks: 'all',
|
|
53
|
-
cacheGroups: {
|
|
54
|
-
vendor: {
|
|
55
|
-
test: /[\\/]node_modules[\\/]/,
|
|
56
|
-
name: 'vendors',
|
|
57
|
-
chunks: 'all'
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
minimize: false,
|
|
62
|
-
minimizer: [
|
|
63
|
-
new TerserPlugin({
|
|
64
|
-
terserOptions: { format: { comments: false } },
|
|
65
|
-
extractComments: false
|
|
66
|
-
})
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
cache: {
|
|
70
|
-
type: 'filesystem',
|
|
71
|
-
buildDependencies: {
|
|
72
|
-
// 更改配置文件时,重新缓存
|
|
73
|
-
config: [__filename]
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
module: {
|
|
77
|
-
rules: [
|
|
78
|
-
{
|
|
79
|
-
test: /\.worker\.ts$/,
|
|
80
|
-
loader: 'worker-loader',
|
|
81
|
-
options: { inline: 'no-fallback' }
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
test: /\.(ts|tsx|js|jsx)$/,
|
|
85
|
-
loader: 'babel-loader',
|
|
86
|
-
options: {
|
|
87
|
-
cacheDirectory: true
|
|
88
|
-
},
|
|
89
|
-
exclude: /node_modules/
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
test: /\.css$/,
|
|
93
|
-
use: getStyleLoader()
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
test: /\.(sass|scss)$/,
|
|
97
|
-
use: getStyleLoader('postcss-loader', 'sass-loader')
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
test: /\.(less)$/,
|
|
101
|
-
use: getStyleLoader({
|
|
102
|
-
loader: 'less-loader',
|
|
103
|
-
options: {
|
|
104
|
-
lessOptions: {
|
|
105
|
-
javascriptEnabled: true,
|
|
106
|
-
modifyVars: {
|
|
107
|
-
'@primary-color': '#3876ff',
|
|
108
|
-
'@success-color': '#32CFA8',
|
|
109
|
-
'@text-color': '#3A3A3A',
|
|
110
|
-
'@primary-5': '#3876ff'
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
})
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
test: /\.(jpe?g|png|gif|woff|woff2|eot|ttf|otf|ogg|wav)$/,
|
|
118
|
-
type: 'asset/resource',
|
|
119
|
-
generator: {
|
|
120
|
-
filename: 'source/[name].[hash:6][ext]'
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
test: /\.svg$/i,
|
|
125
|
-
issuer: /\.[jt]sx?$/,
|
|
126
|
-
use: ['@svgr/webpack']
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
},
|
|
130
|
-
plugins: [
|
|
131
|
-
new HtmlWebpackPlugin({ template: './public/index.html', publicPath: './' }),
|
|
132
|
-
new MiniCssExtractPlugin({ filename: 'css/[name].[hash].css' }),
|
|
133
|
-
new webpack.HotModuleReplacementPlugin({}),
|
|
134
|
-
new webpack.DefinePlugin({
|
|
135
|
-
_BUILDVERSION_: version
|
|
136
|
-
}),
|
|
137
|
-
new CopyPlugin({ patterns: ['public/login.ico'] })
|
|
138
|
-
]
|
|
139
|
-
};
|
package/scripts/webpack.dev.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const { merge } = require('webpack-merge');
|
|
3
|
-
const common = require('./webpack.common.js');
|
|
4
|
-
|
|
5
|
-
module.exports = merge(common, {
|
|
6
|
-
devServer: {
|
|
7
|
-
open: true,
|
|
8
|
-
host: 'localhost',
|
|
9
|
-
hot: true,
|
|
10
|
-
port: 8082,
|
|
11
|
-
static: {
|
|
12
|
-
directory: path.join(__dirname, 'public')
|
|
13
|
-
},
|
|
14
|
-
client: {
|
|
15
|
-
reconnect: 5
|
|
16
|
-
},
|
|
17
|
-
historyApiFallback: true
|
|
18
|
-
},
|
|
19
|
-
target: 'web',
|
|
20
|
-
cache: {
|
|
21
|
-
type: 'filesystem',
|
|
22
|
-
buildDependencies: {
|
|
23
|
-
config: [__filename]
|
|
24
|
-
},
|
|
25
|
-
name: 'development-cache'
|
|
26
|
-
}
|
|
27
|
-
});
|
package/scripts/webpack.sdk.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const webpack = require('webpack');
|
|
3
|
-
const { currentTime } = require('./utils');
|
|
4
|
-
const TerserPlugin = require('terser-webpack-plugin');
|
|
5
|
-
|
|
6
|
-
const version = JSON.stringify(`${require('../package.json').version} - build on ${currentTime()}`);
|
|
7
|
-
const isProduction = !!(process.env.NODE_ENV === 'production');
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
entry: {
|
|
11
|
-
umd: {
|
|
12
|
-
import: './src/index.ts',
|
|
13
|
-
library: { name: 'xyRTC', type: 'umd' }
|
|
14
|
-
},
|
|
15
|
-
cjs: {
|
|
16
|
-
import: './src/index.ts',
|
|
17
|
-
library: { type: 'commonjs' }
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
output: {
|
|
21
|
-
filename: 'xyrtc.[name].js',
|
|
22
|
-
chunkFilename: 'xyrtc_[name].js',
|
|
23
|
-
path: path.resolve(__dirname, '../lib'),
|
|
24
|
-
clean: true
|
|
25
|
-
},
|
|
26
|
-
mode: isProduction ? 'production' : 'development',
|
|
27
|
-
devtool: false,
|
|
28
|
-
resolve: {
|
|
29
|
-
extensions: ['.ts', '.js'],
|
|
30
|
-
alias: {}
|
|
31
|
-
},
|
|
32
|
-
optimization: {
|
|
33
|
-
minimize: true,
|
|
34
|
-
minimizer: [
|
|
35
|
-
new TerserPlugin({
|
|
36
|
-
terserOptions: { format: { comments: false } },
|
|
37
|
-
extractComments: false
|
|
38
|
-
})
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
module: {
|
|
42
|
-
rules: [
|
|
43
|
-
{
|
|
44
|
-
test: /\.worker\.ts$/,
|
|
45
|
-
use: [
|
|
46
|
-
'babel-loader',
|
|
47
|
-
{
|
|
48
|
-
loader: 'worker-loader',
|
|
49
|
-
options: { inline: 'no-fallback' }
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
test: /\.(ts)$/,
|
|
55
|
-
use: [
|
|
56
|
-
'babel-loader',
|
|
57
|
-
{
|
|
58
|
-
loader: 'ts-loader',
|
|
59
|
-
options: {
|
|
60
|
-
configFile: 'tsconfig.lib.json'
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
},
|
|
67
|
-
plugins: [new webpack.DefinePlugin({ _BUILDVERSION_: version })]
|
|
68
|
-
};
|
package/tsconfig.lib.json
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES6",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"sourceMap": true,
|
|
6
|
-
"allowSyntheticDefaultImports": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"noImplicitAny": true,
|
|
10
|
-
"experimentalDecorators": true,
|
|
11
|
-
"preserveConstEnums": true,
|
|
12
|
-
"outDir": "lib",
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"allowJs": true,
|
|
15
|
-
"moduleResolution": "node",
|
|
16
|
-
"skipLibCheck": true,
|
|
17
|
-
"useUnknownInCatchVariables": false,
|
|
18
|
-
"jsx": "preserve",
|
|
19
|
-
"lib": [
|
|
20
|
-
"es2015.promise",
|
|
21
|
-
"es5",
|
|
22
|
-
"dom",
|
|
23
|
-
"webworker"
|
|
24
|
-
],
|
|
25
|
-
"baseUrl": ".",
|
|
26
|
-
"paths": {}
|
|
27
|
-
},
|
|
28
|
-
"exclude": [
|
|
29
|
-
"node_modules",
|
|
30
|
-
"lib",
|
|
31
|
-
"output",
|
|
32
|
-
"build"
|
|
33
|
-
],
|
|
34
|
-
"include": [
|
|
35
|
-
"src/**/*",
|
|
36
|
-
]
|
|
37
|
-
}
|