@xylink/xy-rtc-sdk 3.8.0-beta.6 → 3.8.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylink/xy-rtc-sdk",
3
- "version": "3.8.0-beta.6",
3
+ "version": "3.8.1",
4
4
  "description": "XYLink RTC SDK(小鱼易连WebRTC SDK)",
5
5
  "keywords": [
6
6
  "XYLink RTC SDK",
package/public/login.ico DELETED
Binary file
@@ -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
- };
@@ -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
- });
@@ -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
- }