react-simple-keyboard 3.4.0 → 3.4.4
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/CODE_OF_CONDUCT.md +76 -76
- package/CONTRIBUTING.md +15 -15
- package/LICENSE +21 -21
- package/README.md +75 -75
- package/build/components/Keyboard.d.ts +5 -5
- package/build/components/KeyboardModern.d.ts +5 -5
- package/build/css/index.css +2 -2
- package/build/index.d.ts +4 -4
- package/build/index.js +3 -3
- package/build/index.modern.d.ts +3 -3
- package/build/index.modern.js +2 -2
- package/build/interfaces.d.ts +6 -6
- package/build/services/Utilities.d.ts +49 -49
- package/package.json +5 -4
- package/tsconfig.json +19 -19
- package/webpack.config.demo.js +52 -52
- package/webpack.config.modern.js +93 -93
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { KeyboardReactInterface } from "../interfaces";
|
|
2
|
-
export declare const parseProps: (props: KeyboardReactInterface["options"]) => {
|
|
3
|
-
theme: string;
|
|
4
|
-
layout?: import("simple-keyboard/build/interfaces").KeyboardLayoutObject | undefined;
|
|
5
|
-
layoutName?: string | undefined;
|
|
6
|
-
display?: {
|
|
7
|
-
[button: string]: string;
|
|
8
|
-
} | undefined;
|
|
9
|
-
mergeDisplay?: boolean | undefined;
|
|
10
|
-
buttonTheme?: import("simple-keyboard/build/interfaces").KeyboardButtonTheme[] | undefined;
|
|
11
|
-
buttonAttributes?: import("simple-keyboard/build/interfaces").KeyboardButtonAttributes[] | undefined;
|
|
12
|
-
debug?: boolean | undefined;
|
|
13
|
-
newLineOnEnter?: boolean | undefined;
|
|
14
|
-
tabCharOnTab?: boolean | undefined;
|
|
15
|
-
inputName?: string | undefined;
|
|
16
|
-
maxLength?: any;
|
|
17
|
-
syncInstanceInputs?: boolean | undefined;
|
|
18
|
-
physicalKeyboardHighlight?: boolean | undefined;
|
|
19
|
-
physicalKeyboardHighlightPress?: boolean | undefined;
|
|
20
|
-
physicalKeyboardHighlightPressUseClick?: boolean | undefined;
|
|
21
|
-
physicalKeyboardHighlightTextColor?: string | undefined;
|
|
22
|
-
physicalKeyboardHighlightBgColor?: string | undefined;
|
|
23
|
-
preventMouseDownDefault?: boolean | undefined;
|
|
24
|
-
preventMouseUpDefault?: boolean | undefined;
|
|
25
|
-
stopMouseDownPropagation?: boolean | undefined;
|
|
26
|
-
stopMouseUpPropagation?: boolean | undefined;
|
|
27
|
-
useButtonTag?: boolean | undefined;
|
|
28
|
-
disableCaretPositioning?: boolean | undefined;
|
|
29
|
-
inputPattern?: any;
|
|
30
|
-
useTouchEvents?: boolean | undefined;
|
|
31
|
-
autoUseTouchEvents?: boolean | undefined;
|
|
32
|
-
useMouseEvents?: boolean | undefined;
|
|
33
|
-
disableButtonHold?: boolean | undefined;
|
|
34
|
-
rtl?: boolean | undefined;
|
|
35
|
-
enableLayoutCandidates?: boolean | undefined;
|
|
36
|
-
layoutCandidates?: {
|
|
37
|
-
[key: string]: string;
|
|
38
|
-
} | undefined;
|
|
39
|
-
excludeFromLayout?: {
|
|
40
|
-
[key: string]: string[];
|
|
41
|
-
} | undefined;
|
|
42
|
-
layoutCandidatesPageSize?: number | undefined;
|
|
43
|
-
onRender?: ((instance?: import("simple-keyboard/build/components/Keyboard").default | undefined) => void) | undefined;
|
|
44
|
-
onInit?: ((instance?: import("simple-keyboard/build/components/Keyboard").default | undefined) => void) | undefined;
|
|
45
|
-
onChange?: ((input: string, e?: MouseEvent | undefined) => any) | undefined;
|
|
46
|
-
onChangeAll?: ((inputObj: import("simple-keyboard/build/interfaces").KeyboardInput, e?: MouseEvent | undefined) => any) | undefined;
|
|
47
|
-
keyboardRef?: ((r: any) => void) | undefined;
|
|
48
|
-
};
|
|
49
|
-
export declare const changedProps: (prevProps: KeyboardReactInterface["options"], props: KeyboardReactInterface["options"]) => string[];
|
|
1
|
+
import { KeyboardReactInterface } from "../interfaces";
|
|
2
|
+
export declare const parseProps: (props: KeyboardReactInterface["options"]) => {
|
|
3
|
+
theme: string;
|
|
4
|
+
layout?: import("simple-keyboard/build/interfaces").KeyboardLayoutObject | undefined;
|
|
5
|
+
layoutName?: string | undefined;
|
|
6
|
+
display?: {
|
|
7
|
+
[button: string]: string;
|
|
8
|
+
} | undefined;
|
|
9
|
+
mergeDisplay?: boolean | undefined;
|
|
10
|
+
buttonTheme?: import("simple-keyboard/build/interfaces").KeyboardButtonTheme[] | undefined;
|
|
11
|
+
buttonAttributes?: import("simple-keyboard/build/interfaces").KeyboardButtonAttributes[] | undefined;
|
|
12
|
+
debug?: boolean | undefined;
|
|
13
|
+
newLineOnEnter?: boolean | undefined;
|
|
14
|
+
tabCharOnTab?: boolean | undefined;
|
|
15
|
+
inputName?: string | undefined;
|
|
16
|
+
maxLength?: any;
|
|
17
|
+
syncInstanceInputs?: boolean | undefined;
|
|
18
|
+
physicalKeyboardHighlight?: boolean | undefined;
|
|
19
|
+
physicalKeyboardHighlightPress?: boolean | undefined;
|
|
20
|
+
physicalKeyboardHighlightPressUseClick?: boolean | undefined;
|
|
21
|
+
physicalKeyboardHighlightTextColor?: string | undefined;
|
|
22
|
+
physicalKeyboardHighlightBgColor?: string | undefined;
|
|
23
|
+
preventMouseDownDefault?: boolean | undefined;
|
|
24
|
+
preventMouseUpDefault?: boolean | undefined;
|
|
25
|
+
stopMouseDownPropagation?: boolean | undefined;
|
|
26
|
+
stopMouseUpPropagation?: boolean | undefined;
|
|
27
|
+
useButtonTag?: boolean | undefined;
|
|
28
|
+
disableCaretPositioning?: boolean | undefined;
|
|
29
|
+
inputPattern?: any;
|
|
30
|
+
useTouchEvents?: boolean | undefined;
|
|
31
|
+
autoUseTouchEvents?: boolean | undefined;
|
|
32
|
+
useMouseEvents?: boolean | undefined;
|
|
33
|
+
disableButtonHold?: boolean | undefined;
|
|
34
|
+
rtl?: boolean | undefined;
|
|
35
|
+
enableLayoutCandidates?: boolean | undefined;
|
|
36
|
+
layoutCandidates?: {
|
|
37
|
+
[key: string]: string;
|
|
38
|
+
} | undefined;
|
|
39
|
+
excludeFromLayout?: {
|
|
40
|
+
[key: string]: string[];
|
|
41
|
+
} | undefined;
|
|
42
|
+
layoutCandidatesPageSize?: number | undefined;
|
|
43
|
+
onRender?: ((instance?: import("simple-keyboard/build/components/Keyboard").default | undefined) => void) | undefined;
|
|
44
|
+
onInit?: ((instance?: import("simple-keyboard/build/components/Keyboard").default | undefined) => void) | undefined;
|
|
45
|
+
onChange?: ((input: string, e?: MouseEvent | undefined) => any) | undefined;
|
|
46
|
+
onChangeAll?: ((inputObj: import("simple-keyboard/build/interfaces").KeyboardInput, e?: MouseEvent | undefined) => any) | undefined;
|
|
47
|
+
keyboardRef?: ((r: any) => void) | undefined;
|
|
48
|
+
};
|
|
49
|
+
export declare const changedProps: (prevProps: KeyboardReactInterface["options"], props: KeyboardReactInterface["options"]) => string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-simple-keyboard",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.4",
|
|
4
4
|
"description": "React.js Virtual Keyboard",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -54,11 +54,12 @@
|
|
|
54
54
|
"@types/react-dom": "^17.0.10",
|
|
55
55
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
56
56
|
"@typescript-eslint/parser": "^4.32.0",
|
|
57
|
+
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.5",
|
|
57
58
|
"autoprefixer": "^10.4.0",
|
|
58
59
|
"babel-eslint": "^10.1.0",
|
|
59
60
|
"babel-loader": "^8.2.3",
|
|
60
61
|
"babel-preset-minify": "^0.5.0",
|
|
61
|
-
"core-js": "^3.19.
|
|
62
|
+
"core-js": "^3.19.2",
|
|
62
63
|
"css-loader": "^6.5.1",
|
|
63
64
|
"enzyme": "^3.11.0",
|
|
64
65
|
"enzyme-adapter-react-16": "^1.15.6",
|
|
@@ -68,13 +69,13 @@
|
|
|
68
69
|
"jest": "^26.6.3",
|
|
69
70
|
"mini-css-extract-plugin": "^2.4.5",
|
|
70
71
|
"optimize-css-assets-webpack-plugin": "^6.0.1",
|
|
71
|
-
"postcss": "^8.4.
|
|
72
|
+
"postcss": "^8.4.4",
|
|
72
73
|
"postcss-loader": "^6.2.0",
|
|
73
74
|
"prettier": "^2.5.0",
|
|
74
75
|
"prettier-webpack-plugin": "^1.2.0",
|
|
75
76
|
"react": "^16.14.0 || ^17.0.0",
|
|
76
77
|
"react-dom": "^16.14.0 || ^17.0.0",
|
|
77
|
-
"simple-keyboard": "3.4.
|
|
78
|
+
"simple-keyboard": "3.4.3",
|
|
78
79
|
"style-loader": "^3.2.1",
|
|
79
80
|
"terser-webpack-plugin": "^5.2.5",
|
|
80
81
|
"typescript": "^4.5.2",
|
package/tsconfig.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"noImplicitAny": true,
|
|
4
|
-
"outDir": "build",
|
|
5
|
-
"module": "esnext",
|
|
6
|
-
"target": "es5",
|
|
7
|
-
"allowJs": true,
|
|
8
|
-
"sourceMap": true,
|
|
9
|
-
"declaration": true,
|
|
10
|
-
"emitDeclarationOnly": true,
|
|
11
|
-
"suppressImplicitAnyIndexErrors": true,
|
|
12
|
-
"lib": ["es2020", "dom"],
|
|
13
|
-
"moduleResolution": "node",
|
|
14
|
-
"downlevelIteration": true,
|
|
15
|
-
"jsx": "react",
|
|
16
|
-
"strict": true
|
|
17
|
-
},
|
|
18
|
-
"include": ["src/lib"],
|
|
19
|
-
"exclude": ["src/lib/**/tests"],
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"noImplicitAny": true,
|
|
4
|
+
"outDir": "build",
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
"target": "es5",
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"sourceMap": true,
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"emitDeclarationOnly": true,
|
|
11
|
+
"suppressImplicitAnyIndexErrors": true,
|
|
12
|
+
"lib": ["es2020", "dom"],
|
|
13
|
+
"moduleResolution": "node",
|
|
14
|
+
"downlevelIteration": true,
|
|
15
|
+
"jsx": "react",
|
|
16
|
+
"strict": true
|
|
17
|
+
},
|
|
18
|
+
"include": ["src/lib"],
|
|
19
|
+
"exclude": ["src/lib/**/tests"],
|
|
20
20
|
}
|
package/webpack.config.demo.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
3
|
-
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
mode: "development",
|
|
7
|
-
devtool: 'cheap-module-source-map',
|
|
8
|
-
entry: './src/demo/index.tsx',
|
|
9
|
-
output: {
|
|
10
|
-
path: path.resolve(__dirname, 'demo'),
|
|
11
|
-
filename: 'index.js'
|
|
12
|
-
},
|
|
13
|
-
optimization: {
|
|
14
|
-
minimize: false,
|
|
15
|
-
},
|
|
16
|
-
devServer: {
|
|
17
|
-
open: true,
|
|
18
|
-
hot: true,
|
|
19
|
-
host: "localhost",
|
|
20
|
-
port: 9000
|
|
21
|
-
},
|
|
22
|
-
module: {
|
|
23
|
-
rules: [
|
|
24
|
-
{
|
|
25
|
-
test: /\.(m|j|t)sx?$/,
|
|
26
|
-
exclude: /(node_modules|bower_components)/,
|
|
27
|
-
use: {
|
|
28
|
-
loader: 'babel-loader'
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
test: /\.(sa|sc|c)ss$/,
|
|
33
|
-
use: [
|
|
34
|
-
MiniCssExtractPlugin.loader,
|
|
35
|
-
{ loader: "css-loader", options: { sourceMap: true } },
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
test: /\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/,
|
|
40
|
-
use: ['url-loader'],
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
plugins: [
|
|
45
|
-
new MiniCssExtractPlugin({
|
|
46
|
-
filename: 'css/index.css'
|
|
47
|
-
}),
|
|
48
|
-
new HtmlWebpackPlugin(),
|
|
49
|
-
],
|
|
50
|
-
resolve: {
|
|
51
|
-
extensions: ['.ts', '.tsx', '.js', '.json']
|
|
52
|
-
}
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
3
|
+
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
mode: "development",
|
|
7
|
+
devtool: 'cheap-module-source-map',
|
|
8
|
+
entry: './src/demo/index.tsx',
|
|
9
|
+
output: {
|
|
10
|
+
path: path.resolve(__dirname, 'demo'),
|
|
11
|
+
filename: 'index.js'
|
|
12
|
+
},
|
|
13
|
+
optimization: {
|
|
14
|
+
minimize: false,
|
|
15
|
+
},
|
|
16
|
+
devServer: {
|
|
17
|
+
open: true,
|
|
18
|
+
hot: true,
|
|
19
|
+
host: "localhost",
|
|
20
|
+
port: 9000
|
|
21
|
+
},
|
|
22
|
+
module: {
|
|
23
|
+
rules: [
|
|
24
|
+
{
|
|
25
|
+
test: /\.(m|j|t)sx?$/,
|
|
26
|
+
exclude: /(node_modules|bower_components)/,
|
|
27
|
+
use: {
|
|
28
|
+
loader: 'babel-loader'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
test: /\.(sa|sc|c)ss$/,
|
|
33
|
+
use: [
|
|
34
|
+
MiniCssExtractPlugin.loader,
|
|
35
|
+
{ loader: "css-loader", options: { sourceMap: true } },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
test: /\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/,
|
|
40
|
+
use: ['url-loader'],
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
plugins: [
|
|
45
|
+
new MiniCssExtractPlugin({
|
|
46
|
+
filename: 'css/index.css'
|
|
47
|
+
}),
|
|
48
|
+
new HtmlWebpackPlugin(),
|
|
49
|
+
],
|
|
50
|
+
resolve: {
|
|
51
|
+
extensions: ['.ts', '.tsx', '.js', '.json']
|
|
52
|
+
}
|
|
53
53
|
};
|
package/webpack.config.modern.js
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config to support modern browsers only (build/index.modern.js)
|
|
3
|
-
*/
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const webpack = require('webpack');
|
|
6
|
-
const TerserPlugin = require('terser-webpack-plugin');
|
|
7
|
-
const getPackageJson = require('./scripts/getPackageJson');
|
|
8
|
-
|
|
9
|
-
const {
|
|
10
|
-
version,
|
|
11
|
-
name,
|
|
12
|
-
license,
|
|
13
|
-
repository,
|
|
14
|
-
author,
|
|
15
|
-
} = getPackageJson('version', 'name', 'license', 'repository', 'author');
|
|
16
|
-
|
|
17
|
-
const banner = `
|
|
18
|
-
${name} v${version} (index.modern.js - Modern Browsers bundle)
|
|
19
|
-
${repository.url}
|
|
20
|
-
|
|
21
|
-
NOTE: This modern browsers bundle (index.modern.js) removes all polyfills
|
|
22
|
-
included in the standard version. Use this if you are supporting
|
|
23
|
-
modern browsers only. Otherwise, use the standard version (index.js).
|
|
24
|
-
|
|
25
|
-
Copyright (c) ${author.replace(/ *<[^)]*> */g, " ")} and project contributors.
|
|
26
|
-
|
|
27
|
-
This source code is licensed under the ${license} license found in the
|
|
28
|
-
LICENSE file in the root directory of this source tree.
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
|
-
module.exports = {
|
|
32
|
-
mode: "production",
|
|
33
|
-
entry: './src/lib/index.modern.ts',
|
|
34
|
-
target: 'es5',
|
|
35
|
-
output: {
|
|
36
|
-
filename: 'index.modern.js',
|
|
37
|
-
path: path.resolve(__dirname, 'build'),
|
|
38
|
-
library: "ReactSimpleKeyboard",
|
|
39
|
-
libraryTarget: 'umd',
|
|
40
|
-
globalObject: 'this'
|
|
41
|
-
},
|
|
42
|
-
optimization: {
|
|
43
|
-
minimize: true,
|
|
44
|
-
minimizer: [
|
|
45
|
-
new TerserPlugin({ extractComments: false }),
|
|
46
|
-
],
|
|
47
|
-
},
|
|
48
|
-
externals: {
|
|
49
|
-
react: {
|
|
50
|
-
root: 'React',
|
|
51
|
-
commonjs2: 'react',
|
|
52
|
-
commonjs: 'react',
|
|
53
|
-
amd: 'react'
|
|
54
|
-
},
|
|
55
|
-
'react-dom': {
|
|
56
|
-
root: 'ReactDOM',
|
|
57
|
-
commonjs2: 'react-dom',
|
|
58
|
-
commonjs: 'react-dom',
|
|
59
|
-
amd: 'react-dom'
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
module: {
|
|
63
|
-
rules: [
|
|
64
|
-
{
|
|
65
|
-
test: /\.(js|json|ts|tsx)$/,
|
|
66
|
-
exclude: /(node_modules|bower_components)/,
|
|
67
|
-
use: {
|
|
68
|
-
loader: 'babel-loader',
|
|
69
|
-
options: {
|
|
70
|
-
presets: [
|
|
71
|
-
"@babel/preset-react",
|
|
72
|
-
"@babel/env",
|
|
73
|
-
"@babel/preset-typescript"
|
|
74
|
-
],
|
|
75
|
-
plugins: [
|
|
76
|
-
["@babel/plugin-proposal-class-properties"],
|
|
77
|
-
["@babel/plugin-transform-typescript"]
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
test: /\.(sa|sc|c)ss$/,
|
|
84
|
-
use: path.resolve('scripts/loaderMock.js')
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
plugins: [
|
|
89
|
-
new webpack.BannerPlugin(banner)
|
|
90
|
-
],
|
|
91
|
-
resolve: {
|
|
92
|
-
extensions: ['.ts', '.tsx', '.js', '.json']
|
|
93
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Config to support modern browsers only (build/index.modern.js)
|
|
3
|
+
*/
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const webpack = require('webpack');
|
|
6
|
+
const TerserPlugin = require('terser-webpack-plugin');
|
|
7
|
+
const getPackageJson = require('./scripts/getPackageJson');
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
version,
|
|
11
|
+
name,
|
|
12
|
+
license,
|
|
13
|
+
repository,
|
|
14
|
+
author,
|
|
15
|
+
} = getPackageJson('version', 'name', 'license', 'repository', 'author');
|
|
16
|
+
|
|
17
|
+
const banner = `
|
|
18
|
+
${name} v${version} (index.modern.js - Modern Browsers bundle)
|
|
19
|
+
${repository.url}
|
|
20
|
+
|
|
21
|
+
NOTE: This modern browsers bundle (index.modern.js) removes all polyfills
|
|
22
|
+
included in the standard version. Use this if you are supporting
|
|
23
|
+
modern browsers only. Otherwise, use the standard version (index.js).
|
|
24
|
+
|
|
25
|
+
Copyright (c) ${author.replace(/ *<[^)]*> */g, " ")} and project contributors.
|
|
26
|
+
|
|
27
|
+
This source code is licensed under the ${license} license found in the
|
|
28
|
+
LICENSE file in the root directory of this source tree.
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
module.exports = {
|
|
32
|
+
mode: "production",
|
|
33
|
+
entry: './src/lib/index.modern.ts',
|
|
34
|
+
target: 'es5',
|
|
35
|
+
output: {
|
|
36
|
+
filename: 'index.modern.js',
|
|
37
|
+
path: path.resolve(__dirname, 'build'),
|
|
38
|
+
library: "ReactSimpleKeyboard",
|
|
39
|
+
libraryTarget: 'umd',
|
|
40
|
+
globalObject: 'this'
|
|
41
|
+
},
|
|
42
|
+
optimization: {
|
|
43
|
+
minimize: true,
|
|
44
|
+
minimizer: [
|
|
45
|
+
new TerserPlugin({ extractComments: false }),
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
externals: {
|
|
49
|
+
react: {
|
|
50
|
+
root: 'React',
|
|
51
|
+
commonjs2: 'react',
|
|
52
|
+
commonjs: 'react',
|
|
53
|
+
amd: 'react'
|
|
54
|
+
},
|
|
55
|
+
'react-dom': {
|
|
56
|
+
root: 'ReactDOM',
|
|
57
|
+
commonjs2: 'react-dom',
|
|
58
|
+
commonjs: 'react-dom',
|
|
59
|
+
amd: 'react-dom'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
module: {
|
|
63
|
+
rules: [
|
|
64
|
+
{
|
|
65
|
+
test: /\.(js|json|ts|tsx)$/,
|
|
66
|
+
exclude: /(node_modules|bower_components)/,
|
|
67
|
+
use: {
|
|
68
|
+
loader: 'babel-loader',
|
|
69
|
+
options: {
|
|
70
|
+
presets: [
|
|
71
|
+
"@babel/preset-react",
|
|
72
|
+
"@babel/env",
|
|
73
|
+
"@babel/preset-typescript"
|
|
74
|
+
],
|
|
75
|
+
plugins: [
|
|
76
|
+
["@babel/plugin-proposal-class-properties"],
|
|
77
|
+
["@babel/plugin-transform-typescript"]
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
test: /\.(sa|sc|c)ss$/,
|
|
84
|
+
use: path.resolve('scripts/loaderMock.js')
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
plugins: [
|
|
89
|
+
new webpack.BannerPlugin(banner)
|
|
90
|
+
],
|
|
91
|
+
resolve: {
|
|
92
|
+
extensions: ['.ts', '.tsx', '.js', '.json']
|
|
93
|
+
}
|
|
94
94
|
};
|