react_hsbc_teller 2.0.54 → 2.0.56
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/.babelrc +39 -39
- package/README.en.md +36 -36
- package/README.md +329 -323
- package/config/webpack.config.js +119 -119
- package/config/webpack.dev.js +108 -108
- package/config/webpack.prod.js +104 -104
- package/lib/hsbc.js +1 -1
- package/lib/hsbc.js.LICENSE.txt +13 -16
- package/package.json +110 -110
- package/packages/api/api.js +818 -818
- package/packages/api/server.js +50 -50
- package/packages/common/index.esm.js +374 -374
- package/packages/demo/demo.js +306 -306
- package/packages/demo/index.js +3 -3
- package/packages/demo/pdf.js +94 -94
- package/packages/envconfig/envconfig.js +12 -12
- package/packages/index.js +2 -2
- package/packages/pages/components/step/step.jsx +32 -31
- package/packages/pages/foot/foot.jsx +235 -235
- package/packages/pages/foot/foot.less +85 -85
- package/packages/pages/header/header.jsx +15 -15
- package/packages/pages/header/header.less +51 -51
- package/packages/pages/index.jsx +52 -52
- package/packages/pages/multiModule/components/copy/agree.jsx +115 -115
- package/packages/pages/multiModule/components/copy/agree.less +105 -105
- package/packages/pages/multiModule/components/copy/copyTwo.jsx +682 -682
- package/packages/pages/multiModule/components/copy/copyTwo.less +180 -180
- package/packages/pages/multiModule/components/copy/copy_en.jsx +368 -368
- package/packages/pages/multiModule/components/copy/copy_en.less +145 -145
- package/packages/pages/multiModule/components/copy/copylist.jsx +291 -291
- package/packages/pages/multiModule/components/copy/copylist.less +83 -83
- package/packages/pages/multiModule/components/copy/risk.jsx +296 -296
- package/packages/pages/multiModule/components/copy/risk.less +123 -123
- package/packages/pages/multiModule/components/sign/signMy.jsx +308 -308
- package/packages/pages/multiModule/components/sign/signMy.less +127 -127
- package/packages/pages/multiModule/components/subscribe/subscribe.jsx +113 -113
- package/packages/pages/multiModule/components/subscribe/subscribe.less +82 -82
- package/packages/pages/multiModule/multiModule.jsx +26 -26
- package/packages/pages/multiModule/multiModule.less +19 -19
- package/packages/pages/sign/signMy.jsx +223 -223
- package/packages/pages/sign/signMy.less +129 -129
- package/packages/pages/video/video.jsx +7746 -7745
- package/packages/pages/video/video.less +715 -715
- package/packages/style/index.less +1 -1
- package/packages/style/reset.less +345 -345
- package/packages/utils/asrController.js +259 -259
- package/packages/utils/asyncComponent.jsx +26 -26
- package/packages/utils/mixin.js +27 -27
- package/packages/utils/setRem.js +10 -10
- package/packages/utils/utils.js +199 -199
- package/public/index.html +77 -77
- package/src/index.js +11 -11
- package/src/index.less +5 -5
- package/tsconfig.json +11 -11
package/config/webpack.config.js
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const webpack = require("webpack");
|
|
3
|
-
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
4
|
-
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
5
|
-
const WebpackBar = require("webpackbar");
|
|
6
|
-
const autoprefixer = require("autoprefixer");
|
|
7
|
-
const px2rem = require("postcss-px2rem");
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
entry: path.join(__dirname, "../packages/index.js"),
|
|
11
|
-
output: {
|
|
12
|
-
path: path.resolve(__dirname, "../lib"),
|
|
13
|
-
filename: "hsbc.js",
|
|
14
|
-
library: "hsbc",
|
|
15
|
-
libraryTarget: "umd",
|
|
16
|
-
},
|
|
17
|
-
resolve: {
|
|
18
|
-
extensions: [".tsx", ".ts", ".js", ".jsx"],
|
|
19
|
-
alias: {
|
|
20
|
-
"@":path.resolve("packages"),
|
|
21
|
-
"@src":path.resolve("src"),
|
|
22
|
-
"@component":path.resolve("packages/component"),
|
|
23
|
-
"@public":path.resolve("public"),
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
module: {
|
|
27
|
-
rules: [
|
|
28
|
-
{
|
|
29
|
-
test: /\.(css|less)$/,
|
|
30
|
-
use: [
|
|
31
|
-
require.resolve('style-loader'),
|
|
32
|
-
{
|
|
33
|
-
loader: require.resolve('css-loader'),
|
|
34
|
-
options: {
|
|
35
|
-
importLoaders: 1,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
loader: require.resolve('postcss-loader'),
|
|
40
|
-
options: {
|
|
41
|
-
ident: 'postcss',
|
|
42
|
-
plugins: () => [
|
|
43
|
-
require('postcss-flexbugs-fixes'),
|
|
44
|
-
autoprefixer({
|
|
45
|
-
browsers: [
|
|
46
|
-
'>1%',
|
|
47
|
-
'last 4 versions',
|
|
48
|
-
'Firefox ESR',
|
|
49
|
-
'not ie < 9', // React doesn't support IE8 anyway
|
|
50
|
-
],
|
|
51
|
-
flexbox: 'no-2009',
|
|
52
|
-
}),
|
|
53
|
-
px2rem({
|
|
54
|
-
remUnit: 19.20,
|
|
55
|
-
exclude: /node-modules/i,
|
|
56
|
-
}),
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
loader: require.resolve('less-loader')
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
test: /\.(png|svg|jpg|gif|mp3)$/,
|
|
67
|
-
use: [
|
|
68
|
-
{
|
|
69
|
-
loader: 'url-loader',
|
|
70
|
-
options: {
|
|
71
|
-
limit: 200000,
|
|
72
|
-
},
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
test: /\.(woff|woff2|eot|ttf|otf)$/,
|
|
78
|
-
use: ["file-loader"],
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
test: /\.tsx?$/,
|
|
82
|
-
exclude: /node_modules/,
|
|
83
|
-
use: "ts-loader",
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
test: /\.(js|jsx)$/,
|
|
87
|
-
exclude: /node_modules/,
|
|
88
|
-
use: [
|
|
89
|
-
{
|
|
90
|
-
loader: 'babel-loader',
|
|
91
|
-
options: {plugins:["@babel/plugin-transform-runtime"]},
|
|
92
|
-
}
|
|
93
|
-
],
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
plugins: [
|
|
98
|
-
new WebpackBar(),
|
|
99
|
-
new CleanWebpackPlugin(),
|
|
100
|
-
new HtmlWebpackPlugin({
|
|
101
|
-
title: "lib 创建 library",
|
|
102
|
-
template: path.resolve(__dirname, "../public/index.html"),
|
|
103
|
-
}),
|
|
104
|
-
],
|
|
105
|
-
externals: {
|
|
106
|
-
react: {
|
|
107
|
-
commonjs: 'react',
|
|
108
|
-
commonjs2: 'react',
|
|
109
|
-
amd: 'react',
|
|
110
|
-
root: 'React',
|
|
111
|
-
},
|
|
112
|
-
'react-dom': {
|
|
113
|
-
commonjs: 'react-dom',
|
|
114
|
-
commonjs2: 'react-dom',
|
|
115
|
-
amd: 'react-dom',
|
|
116
|
-
root: 'ReactDOM',
|
|
117
|
-
},
|
|
118
|
-
}
|
|
119
|
-
};
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const webpack = require("webpack");
|
|
3
|
+
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
4
|
+
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
5
|
+
const WebpackBar = require("webpackbar");
|
|
6
|
+
const autoprefixer = require("autoprefixer");
|
|
7
|
+
const px2rem = require("postcss-px2rem");
|
|
8
|
+
|
|
9
|
+
module.exports = {
|
|
10
|
+
entry: path.join(__dirname, "../packages/index.js"),
|
|
11
|
+
output: {
|
|
12
|
+
path: path.resolve(__dirname, "../lib"),
|
|
13
|
+
filename: "hsbc.js",
|
|
14
|
+
library: "hsbc",
|
|
15
|
+
libraryTarget: "umd",
|
|
16
|
+
},
|
|
17
|
+
resolve: {
|
|
18
|
+
extensions: [".tsx", ".ts", ".js", ".jsx"],
|
|
19
|
+
alias: {
|
|
20
|
+
"@":path.resolve("packages"),
|
|
21
|
+
"@src":path.resolve("src"),
|
|
22
|
+
"@component":path.resolve("packages/component"),
|
|
23
|
+
"@public":path.resolve("public"),
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
module: {
|
|
27
|
+
rules: [
|
|
28
|
+
{
|
|
29
|
+
test: /\.(css|less)$/,
|
|
30
|
+
use: [
|
|
31
|
+
require.resolve('style-loader'),
|
|
32
|
+
{
|
|
33
|
+
loader: require.resolve('css-loader'),
|
|
34
|
+
options: {
|
|
35
|
+
importLoaders: 1,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
loader: require.resolve('postcss-loader'),
|
|
40
|
+
options: {
|
|
41
|
+
ident: 'postcss',
|
|
42
|
+
plugins: () => [
|
|
43
|
+
require('postcss-flexbugs-fixes'),
|
|
44
|
+
autoprefixer({
|
|
45
|
+
browsers: [
|
|
46
|
+
'>1%',
|
|
47
|
+
'last 4 versions',
|
|
48
|
+
'Firefox ESR',
|
|
49
|
+
'not ie < 9', // React doesn't support IE8 anyway
|
|
50
|
+
],
|
|
51
|
+
flexbox: 'no-2009',
|
|
52
|
+
}),
|
|
53
|
+
px2rem({
|
|
54
|
+
remUnit: 19.20,
|
|
55
|
+
exclude: /node-modules/i,
|
|
56
|
+
}),
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
loader: require.resolve('less-loader')
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
test: /\.(png|svg|jpg|gif|mp3)$/,
|
|
67
|
+
use: [
|
|
68
|
+
{
|
|
69
|
+
loader: 'url-loader',
|
|
70
|
+
options: {
|
|
71
|
+
limit: 200000,
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
test: /\.(woff|woff2|eot|ttf|otf)$/,
|
|
78
|
+
use: ["file-loader"],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
test: /\.tsx?$/,
|
|
82
|
+
exclude: /node_modules/,
|
|
83
|
+
use: "ts-loader",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
test: /\.(js|jsx)$/,
|
|
87
|
+
exclude: /node_modules/,
|
|
88
|
+
use: [
|
|
89
|
+
{
|
|
90
|
+
loader: 'babel-loader',
|
|
91
|
+
options: {plugins:["@babel/plugin-transform-runtime"]},
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
plugins: [
|
|
98
|
+
new WebpackBar(),
|
|
99
|
+
new CleanWebpackPlugin(),
|
|
100
|
+
new HtmlWebpackPlugin({
|
|
101
|
+
title: "lib 创建 library",
|
|
102
|
+
template: path.resolve(__dirname, "../public/index.html"),
|
|
103
|
+
}),
|
|
104
|
+
],
|
|
105
|
+
externals: {
|
|
106
|
+
react: {
|
|
107
|
+
commonjs: 'react',
|
|
108
|
+
commonjs2: 'react',
|
|
109
|
+
amd: 'react',
|
|
110
|
+
root: 'React',
|
|
111
|
+
},
|
|
112
|
+
'react-dom': {
|
|
113
|
+
commonjs: 'react-dom',
|
|
114
|
+
commonjs2: 'react-dom',
|
|
115
|
+
amd: 'react-dom',
|
|
116
|
+
root: 'ReactDOM',
|
|
117
|
+
},
|
|
118
|
+
}
|
|
119
|
+
};
|
package/config/webpack.dev.js
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const webpack = require("webpack");
|
|
3
|
-
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
4
|
-
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
5
|
-
const WebpackBar = require("webpackbar");
|
|
6
|
-
const autoprefixer = require('autoprefixer');
|
|
7
|
-
const px2rem = require('postcss-px2rem');
|
|
8
|
-
module.exports = {
|
|
9
|
-
entry: "./src/index.js",
|
|
10
|
-
output: {
|
|
11
|
-
publicPath: "/",
|
|
12
|
-
path: path.resolve(__dirname, "../dist"),
|
|
13
|
-
filename: "index.js",
|
|
14
|
-
},
|
|
15
|
-
// devtool: "inline-source-map",
|
|
16
|
-
resolve: {
|
|
17
|
-
extensions: [".tsx", ".ts", ".js", ".jsx"],
|
|
18
|
-
alias: {
|
|
19
|
-
"@":path.resolve("packages"),
|
|
20
|
-
"@src":path.resolve("src"),
|
|
21
|
-
"@component":path.resolve("packages/component"),
|
|
22
|
-
"@public":path.resolve("public"),
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
module: {
|
|
26
|
-
rules: [
|
|
27
|
-
{
|
|
28
|
-
test: /\.(css|less)$/,
|
|
29
|
-
use: [
|
|
30
|
-
require.resolve('style-loader'),
|
|
31
|
-
{
|
|
32
|
-
loader: require.resolve('css-loader'),
|
|
33
|
-
options: {
|
|
34
|
-
importLoaders: 1,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
loader: require.resolve('postcss-loader'),
|
|
39
|
-
options: {
|
|
40
|
-
ident: 'postcss',
|
|
41
|
-
plugins: () => [
|
|
42
|
-
require('postcss-flexbugs-fixes'),
|
|
43
|
-
autoprefixer({
|
|
44
|
-
browsers: [
|
|
45
|
-
'>1%',
|
|
46
|
-
'last 4 versions',
|
|
47
|
-
'Firefox ESR',
|
|
48
|
-
'not ie < 9', // React doesn't support IE8 anyway
|
|
49
|
-
],
|
|
50
|
-
flexbox: 'no-2009',
|
|
51
|
-
}),
|
|
52
|
-
px2rem({
|
|
53
|
-
remUnit: 19.20,
|
|
54
|
-
exclude: /node-modules/i,
|
|
55
|
-
}),
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
loader: require.resolve('less-loader'),
|
|
61
|
-
options: { javascriptEnabled: true }
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
test: /\.(png|svg|jpg|gif)$/,
|
|
67
|
-
use: [
|
|
68
|
-
{
|
|
69
|
-
loader: 'url-loader',
|
|
70
|
-
options: {
|
|
71
|
-
limit: 8192,
|
|
72
|
-
},
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
test: /\.(woff|woff2|eot|ttf|otf|mp3)$/,
|
|
78
|
-
use: ["file-loader"],
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
test: /\.tsx?$/,
|
|
82
|
-
exclude: /node_modules/,
|
|
83
|
-
use: "ts-loader",
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
test: /\.(js|jsx)$/,
|
|
87
|
-
exclude: /node_modules/,
|
|
88
|
-
use: "babel-loader",
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
plugins: [
|
|
93
|
-
new WebpackBar(),
|
|
94
|
-
new CleanWebpackPlugin(),
|
|
95
|
-
new HtmlWebpackPlugin({
|
|
96
|
-
title: "dev 开发环境",
|
|
97
|
-
template: path.resolve(__dirname, "../public/index.html"),
|
|
98
|
-
}),
|
|
99
|
-
new webpack.HotModuleReplacementPlugin(),
|
|
100
|
-
],
|
|
101
|
-
devServer: {
|
|
102
|
-
contentBase: path.resolve(__dirname, "../dist"),
|
|
103
|
-
compress: true,
|
|
104
|
-
port: 9000,
|
|
105
|
-
open: true,
|
|
106
|
-
hot: true,
|
|
107
|
-
},
|
|
108
|
-
};
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const webpack = require("webpack");
|
|
3
|
+
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
4
|
+
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
5
|
+
const WebpackBar = require("webpackbar");
|
|
6
|
+
const autoprefixer = require('autoprefixer');
|
|
7
|
+
const px2rem = require('postcss-px2rem');
|
|
8
|
+
module.exports = {
|
|
9
|
+
entry: "./src/index.js",
|
|
10
|
+
output: {
|
|
11
|
+
publicPath: "/",
|
|
12
|
+
path: path.resolve(__dirname, "../dist"),
|
|
13
|
+
filename: "index.js",
|
|
14
|
+
},
|
|
15
|
+
// devtool: "inline-source-map",
|
|
16
|
+
resolve: {
|
|
17
|
+
extensions: [".tsx", ".ts", ".js", ".jsx"],
|
|
18
|
+
alias: {
|
|
19
|
+
"@":path.resolve("packages"),
|
|
20
|
+
"@src":path.resolve("src"),
|
|
21
|
+
"@component":path.resolve("packages/component"),
|
|
22
|
+
"@public":path.resolve("public"),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
module: {
|
|
26
|
+
rules: [
|
|
27
|
+
{
|
|
28
|
+
test: /\.(css|less)$/,
|
|
29
|
+
use: [
|
|
30
|
+
require.resolve('style-loader'),
|
|
31
|
+
{
|
|
32
|
+
loader: require.resolve('css-loader'),
|
|
33
|
+
options: {
|
|
34
|
+
importLoaders: 1,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
loader: require.resolve('postcss-loader'),
|
|
39
|
+
options: {
|
|
40
|
+
ident: 'postcss',
|
|
41
|
+
plugins: () => [
|
|
42
|
+
require('postcss-flexbugs-fixes'),
|
|
43
|
+
autoprefixer({
|
|
44
|
+
browsers: [
|
|
45
|
+
'>1%',
|
|
46
|
+
'last 4 versions',
|
|
47
|
+
'Firefox ESR',
|
|
48
|
+
'not ie < 9', // React doesn't support IE8 anyway
|
|
49
|
+
],
|
|
50
|
+
flexbox: 'no-2009',
|
|
51
|
+
}),
|
|
52
|
+
px2rem({
|
|
53
|
+
remUnit: 19.20,
|
|
54
|
+
exclude: /node-modules/i,
|
|
55
|
+
}),
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
loader: require.resolve('less-loader'),
|
|
61
|
+
options: { javascriptEnabled: true }
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
test: /\.(png|svg|jpg|gif)$/,
|
|
67
|
+
use: [
|
|
68
|
+
{
|
|
69
|
+
loader: 'url-loader',
|
|
70
|
+
options: {
|
|
71
|
+
limit: 8192,
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
test: /\.(woff|woff2|eot|ttf|otf|mp3)$/,
|
|
78
|
+
use: ["file-loader"],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
test: /\.tsx?$/,
|
|
82
|
+
exclude: /node_modules/,
|
|
83
|
+
use: "ts-loader",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
test: /\.(js|jsx)$/,
|
|
87
|
+
exclude: /node_modules/,
|
|
88
|
+
use: "babel-loader",
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
plugins: [
|
|
93
|
+
new WebpackBar(),
|
|
94
|
+
new CleanWebpackPlugin(),
|
|
95
|
+
new HtmlWebpackPlugin({
|
|
96
|
+
title: "dev 开发环境",
|
|
97
|
+
template: path.resolve(__dirname, "../public/index.html"),
|
|
98
|
+
}),
|
|
99
|
+
new webpack.HotModuleReplacementPlugin(),
|
|
100
|
+
],
|
|
101
|
+
devServer: {
|
|
102
|
+
contentBase: path.resolve(__dirname, "../dist"),
|
|
103
|
+
compress: true,
|
|
104
|
+
port: 9000,
|
|
105
|
+
open: true,
|
|
106
|
+
hot: true,
|
|
107
|
+
},
|
|
108
|
+
};
|
package/config/webpack.prod.js
CHANGED
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const webpack = require("webpack");
|
|
3
|
-
const WebpackBar = require("webpackbar");
|
|
4
|
-
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
5
|
-
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
6
|
-
const autoprefixer = require("autoprefixer");
|
|
7
|
-
const px2rem = require("postcss-px2rem");
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
mode: "production",
|
|
11
|
-
entry: "./src/index.js",
|
|
12
|
-
output: {
|
|
13
|
-
path: path.resolve(__dirname, "../dist"),
|
|
14
|
-
filename: "index.js",
|
|
15
|
-
},
|
|
16
|
-
resolve: {
|
|
17
|
-
extensions: [".tsx", ".ts", ".js", ".jsx"],
|
|
18
|
-
alias: {
|
|
19
|
-
"@":path.resolve("packages"),
|
|
20
|
-
"@src":path.resolve("src"),
|
|
21
|
-
"@component":path.resolve("packages/component"),
|
|
22
|
-
"@public":path.resolve("public"),
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
module: {
|
|
26
|
-
rules: [
|
|
27
|
-
{
|
|
28
|
-
test: /\.(css|less)$/,
|
|
29
|
-
use: [
|
|
30
|
-
require.resolve('style-loader'),
|
|
31
|
-
{
|
|
32
|
-
loader: require.resolve('css-loader'),
|
|
33
|
-
options: {
|
|
34
|
-
importLoaders: 1,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
loader: require.resolve('postcss-loader'),
|
|
39
|
-
options: {
|
|
40
|
-
ident: 'postcss',
|
|
41
|
-
plugins: () => [
|
|
42
|
-
require('postcss-flexbugs-fixes'),
|
|
43
|
-
autoprefixer({
|
|
44
|
-
browsers: [
|
|
45
|
-
'>1%',
|
|
46
|
-
'last 4 versions',
|
|
47
|
-
'Firefox ESR',
|
|
48
|
-
'not ie < 9', // React doesn't support IE8 anyway
|
|
49
|
-
],
|
|
50
|
-
flexbox: 'no-2009',
|
|
51
|
-
}),
|
|
52
|
-
px2rem({
|
|
53
|
-
remUnit: 19.20,
|
|
54
|
-
exclude: /node-modules/i,
|
|
55
|
-
}),
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
loader: require.resolve('less-loader')
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
test: /\.(png|svg|jpg|gif|mp3)$/,
|
|
66
|
-
use: [
|
|
67
|
-
{
|
|
68
|
-
loader: 'url-loader',
|
|
69
|
-
options: {
|
|
70
|
-
limit: 200000,
|
|
71
|
-
},
|
|
72
|
-
}
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
test: /\.(woff|woff2|eot|ttf|otf)$/,
|
|
77
|
-
use: ["file-loader"],
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
test: /\.tsx?$/,
|
|
81
|
-
exclude: /node_modules/,
|
|
82
|
-
use: "ts-loader",
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
test: /\.(js|jsx)$/,
|
|
86
|
-
exclude: /node_modules/,
|
|
87
|
-
use: [
|
|
88
|
-
{
|
|
89
|
-
loader: 'babel-loader',
|
|
90
|
-
options: {plugins:["@babel/plugin-transform-runtime"]},
|
|
91
|
-
}
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
},
|
|
96
|
-
plugins: [
|
|
97
|
-
new WebpackBar(),
|
|
98
|
-
new CleanWebpackPlugin(),
|
|
99
|
-
new HtmlWebpackPlugin({
|
|
100
|
-
title: "prod 生产环境",
|
|
101
|
-
template: path.resolve(__dirname, "../public/index.html"),
|
|
102
|
-
}),
|
|
103
|
-
],
|
|
104
|
-
};
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const webpack = require("webpack");
|
|
3
|
+
const WebpackBar = require("webpackbar");
|
|
4
|
+
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
5
|
+
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
6
|
+
const autoprefixer = require("autoprefixer");
|
|
7
|
+
const px2rem = require("postcss-px2rem");
|
|
8
|
+
|
|
9
|
+
module.exports = {
|
|
10
|
+
mode: "production",
|
|
11
|
+
entry: "./src/index.js",
|
|
12
|
+
output: {
|
|
13
|
+
path: path.resolve(__dirname, "../dist"),
|
|
14
|
+
filename: "index.js",
|
|
15
|
+
},
|
|
16
|
+
resolve: {
|
|
17
|
+
extensions: [".tsx", ".ts", ".js", ".jsx"],
|
|
18
|
+
alias: {
|
|
19
|
+
"@":path.resolve("packages"),
|
|
20
|
+
"@src":path.resolve("src"),
|
|
21
|
+
"@component":path.resolve("packages/component"),
|
|
22
|
+
"@public":path.resolve("public"),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
module: {
|
|
26
|
+
rules: [
|
|
27
|
+
{
|
|
28
|
+
test: /\.(css|less)$/,
|
|
29
|
+
use: [
|
|
30
|
+
require.resolve('style-loader'),
|
|
31
|
+
{
|
|
32
|
+
loader: require.resolve('css-loader'),
|
|
33
|
+
options: {
|
|
34
|
+
importLoaders: 1,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
loader: require.resolve('postcss-loader'),
|
|
39
|
+
options: {
|
|
40
|
+
ident: 'postcss',
|
|
41
|
+
plugins: () => [
|
|
42
|
+
require('postcss-flexbugs-fixes'),
|
|
43
|
+
autoprefixer({
|
|
44
|
+
browsers: [
|
|
45
|
+
'>1%',
|
|
46
|
+
'last 4 versions',
|
|
47
|
+
'Firefox ESR',
|
|
48
|
+
'not ie < 9', // React doesn't support IE8 anyway
|
|
49
|
+
],
|
|
50
|
+
flexbox: 'no-2009',
|
|
51
|
+
}),
|
|
52
|
+
px2rem({
|
|
53
|
+
remUnit: 19.20,
|
|
54
|
+
exclude: /node-modules/i,
|
|
55
|
+
}),
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
loader: require.resolve('less-loader')
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
test: /\.(png|svg|jpg|gif|mp3)$/,
|
|
66
|
+
use: [
|
|
67
|
+
{
|
|
68
|
+
loader: 'url-loader',
|
|
69
|
+
options: {
|
|
70
|
+
limit: 200000,
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
test: /\.(woff|woff2|eot|ttf|otf)$/,
|
|
77
|
+
use: ["file-loader"],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
test: /\.tsx?$/,
|
|
81
|
+
exclude: /node_modules/,
|
|
82
|
+
use: "ts-loader",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
test: /\.(js|jsx)$/,
|
|
86
|
+
exclude: /node_modules/,
|
|
87
|
+
use: [
|
|
88
|
+
{
|
|
89
|
+
loader: 'babel-loader',
|
|
90
|
+
options: {plugins:["@babel/plugin-transform-runtime"]},
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
plugins: [
|
|
97
|
+
new WebpackBar(),
|
|
98
|
+
new CleanWebpackPlugin(),
|
|
99
|
+
new HtmlWebpackPlugin({
|
|
100
|
+
title: "prod 生产环境",
|
|
101
|
+
template: path.resolve(__dirname, "../public/index.html"),
|
|
102
|
+
}),
|
|
103
|
+
],
|
|
104
|
+
};
|