Skip to content

Commit ef2c661

Browse files
author
mcallegari10
committed
Fix JSX issue on building
Change width in sender button
1 parent 49a5ba0 commit ef2c661

File tree

10 files changed

+7298
-7093
lines changed

10 files changed

+7298
-7093
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ yarn-error.log
77
.DS_Store
88

99
# Build files
10-
# lib
10+
./lib
1111

1212
# Test files
1313
coverage

dev/App.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export default class App extends Component {
4747
imagePreview
4848
handleSubmit={this.handleSubmit}
4949
emojis
50-
resizable
5150
/>
5251
);
5352
}

index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'react/jsx-runtime';
2+
13
import ConnectedWidget from './src';
24
import {
35
addUserMessage,

lib/index.js

+26-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/styles.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+7,246-7,074
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-chat-widget",
3-
"version": "3.1.0",
3+
"version": "3.1.2",
44
"description": "Chat web widget for React apps",
55
"main": "lib/index.js",
66
"repository": "[email protected]:Wolox/react-chat-widget.git",
@@ -34,15 +34,16 @@
3434
"@babel/core": "^7.14.0",
3535
"@babel/plugin-proposal-class-properties": "^7.8.3",
3636
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
37+
"@babel/plugin-transform-react-jsx": "^7.14.9",
3738
"@babel/preset-env": "^7.14.1",
38-
"@babel/preset-react": "^7.13.13",
39+
"@babel/preset-react": "^7.14.5",
3940
"@babel/preset-typescript": "^7.8.3",
4041
"@toycode/markdown-it-class": "^1.2.3",
4142
"@types/classnames": "^2.2.10",
4243
"@types/enzyme": "^3.10.5",
4344
"@types/jest": "^25.1.4",
44-
"@types/react": "^16.9.23",
45-
"@types/react-dom": "^16.9.5",
45+
"@types/react": "^17.0.37",
46+
"@types/react-dom": "^17.0.11",
4647
"@types/react-redux": "^7.1.7",
4748
"@typescript-eslint/eslint-plugin": "^4.22.0",
4849
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.1",

src/components/Widget/components/Conversation/components/Sender/style.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
border-radius: 5px;
2424
padding: 10px 5px;
2525
resize: none;
26-
width: calc(100% - 45px);
26+
width: calc(100% - 75px);
2727

2828
&:focus {
2929
outline: none;

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"module": "commonjs",
1313
"moduleResolution": "node",
1414
"target": "es6",
15-
"jsx": "react-jsxdev",
15+
"jsx": "react-jsx",
1616
"allowJs": true,
1717
"lib": [
1818
"dom",

webpack.config.prod.js

+15-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ module.exports = {
1616
clean: true
1717
},
1818
resolve: {
19-
extensions: ['.tsx', '.ts', '.js']
19+
extensions: ['.tsx', '.ts', '.js'],
20+
alias: {
21+
react: path.resolve(__dirname, './node_modules/react'),
22+
'react-dom': path.resolve(__dirname, './node_modules/react-dom'),
23+
'react/jsx-runtime': require.resolve('./node_modules/react/jsx-runtime')
24+
}
2025
},
2126
target: 'web',
2227
mode: 'production',
@@ -76,17 +81,22 @@ module.exports = {
7681
filename: 'styles.css',
7782
chunkFilename: '[id].css'
7883
}),
84+
new webpack.ProvidePlugin({
85+
'react': 'React'
86+
})
7987
],
8088
externals: {
8189
react: {
82-
commonjs: 'React',
90+
root: 'React',
8391
commonjs2: 'react',
92+
commonjs: 'react',
8493
amd: 'react'
8594
},
8695
'react-dom': {
87-
commonjs: 'ReactDOM',
88-
commonjs2: 'react-dom',
89-
amd: 'react-dom'
96+
root: 'ReactDOM',
97+
commonjs2: 'react-dom',
98+
commonjs: 'react-dom',
99+
amd: 'react-dom'
90100
}
91101
},
92102
optimization: {

0 commit comments

Comments
 (0)