Skip to content

Commit

Permalink
chore(templates/react): add webchat-entry to react and all templates
Browse files Browse the repository at this point in the history
  • Loading branch information
vanbasten17 committed Sep 30, 2020
1 parent 6014e3b commit 36ea33c
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/botonic-cli/templates/blank/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const resolveConfig = {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
alias: {
BotonicProject: path.resolve(__dirname, 'src'),
webchat: path.resolve(__dirname, 'src', 'webchat'),
react: path.resolve(__dirname, 'node_modules', 'react'),
'styled-components': path.resolve(
__dirname,
Expand Down Expand Up @@ -167,7 +168,7 @@ function botonicWebchatConfig(mode) {
mode: mode,
devtool: sourceMap(mode),
target: 'web',
entry: path.resolve(botonicPath, 'src', 'entry.js'),
entry: path.resolve(botonicPath, 'src', 'webchat-entry.js'),
module: {
rules: [babelLoaderConfig, fileLoaderConfig, stylesLoaderConfig],
},
Expand Down
3 changes: 2 additions & 1 deletion packages/botonic-cli/templates/childs/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const resolveConfig = {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
alias: {
BotonicProject: path.resolve(__dirname, 'src'),
webchat: path.resolve(__dirname, 'src', 'webchat'),
react: path.resolve(__dirname, 'node_modules', 'react'),
'styled-components': path.resolve(
__dirname,
Expand Down Expand Up @@ -167,7 +168,7 @@ function botonicWebchatConfig(mode) {
mode: mode,
devtool: sourceMap(mode),
target: 'web',
entry: path.resolve(botonicPath, 'src', 'entry.js'),
entry: path.resolve(botonicPath, 'src', 'webchat-entry.js'),
module: {
rules: [babelLoaderConfig, fileLoaderConfig, stylesLoaderConfig],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const resolveConfig = {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
alias: {
BotonicProject: path.resolve(__dirname, 'src'),
webchat: path.resolve(__dirname, 'src', 'webchat'),
react: path.resolve(__dirname, 'node_modules', 'react'),
'styled-components': path.resolve(
__dirname,
Expand Down Expand Up @@ -167,7 +168,7 @@ function botonicWebchatConfig(mode) {
mode: mode,
devtool: sourceMap(mode),
target: 'web',
entry: path.resolve(botonicPath, 'src', 'entry.js'),
entry: path.resolve(botonicPath, 'src', 'webchat-entry.js'),
module: {
rules: [babelLoaderConfig, fileLoaderConfig, stylesLoaderConfig],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const resolveConfig = {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
alias: {
BotonicProject: path.resolve(__dirname, 'src'),
webchat: path.resolve(__dirname, 'src', 'webchat'),
react: path.resolve(__dirname, 'node_modules', 'react'),
'styled-components': path.resolve(
__dirname,
Expand Down Expand Up @@ -167,7 +168,7 @@ function botonicWebchatConfig(mode) {
mode: mode,
devtool: sourceMap(mode),
target: 'web',
entry: path.resolve(botonicPath, 'src', 'entry.js'),
entry: path.resolve(botonicPath, 'src', 'webchat-entry.js'),
module: {
rules: [babelLoaderConfig, fileLoaderConfig, stylesLoaderConfig],
},
Expand Down
3 changes: 2 additions & 1 deletion packages/botonic-cli/templates/dynamodb/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const resolveConfig = {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
alias: {
BotonicProject: path.resolve(__dirname, 'src'),
webchat: path.resolve(__dirname, 'src', 'webchat'),
react: path.resolve(__dirname, 'node_modules', 'react'),
'styled-components': path.resolve(
__dirname,
Expand Down Expand Up @@ -171,7 +172,7 @@ function botonicWebchatConfig(mode) {
mode: mode,
devtool: sourceMap(mode),
target: 'web',
entry: path.resolve(botonicPath, 'src', 'entry.js'),
entry: path.resolve(botonicPath, 'src', 'webchat-entry.js'),
module: {
rules: [babelLoaderConfig, fileLoaderConfig, stylesLoaderConfig],
},
Expand Down
3 changes: 2 additions & 1 deletion packages/botonic-cli/templates/handoff/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const resolveConfig = {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
alias: {
BotonicProject: path.resolve(__dirname, 'src'),
webchat: path.resolve(__dirname, 'src', 'webchat'),
react: path.resolve(__dirname, 'node_modules', 'react'),
'styled-components': path.resolve(
__dirname,
Expand Down Expand Up @@ -167,7 +168,7 @@ function botonicWebchatConfig(mode) {
mode: mode,
devtool: sourceMap(mode),
target: 'web',
entry: path.resolve(botonicPath, 'src', 'entry.js'),
entry: path.resolve(botonicPath, 'src', 'webchat-entry.js'),
module: {
rules: [babelLoaderConfig, fileLoaderConfig, stylesLoaderConfig],
},
Expand Down
3 changes: 2 additions & 1 deletion packages/botonic-cli/templates/intent/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const resolveConfig = {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
alias: {
BotonicProject: path.resolve(__dirname, 'src'),
webchat: path.resolve(__dirname, 'src', 'webchat'),
react: path.resolve(__dirname, 'node_modules', 'react'),
'styled-components': path.resolve(
__dirname,
Expand Down Expand Up @@ -167,7 +168,7 @@ function botonicWebchatConfig(mode) {
mode: mode,
devtool: sourceMap(mode),
target: 'web',
entry: path.resolve(botonicPath, 'src', 'entry.js'),
entry: path.resolve(botonicPath, 'src', 'webchat-entry.js'),
module: {
rules: [babelLoaderConfig, fileLoaderConfig, stylesLoaderConfig],
},
Expand Down
3 changes: 2 additions & 1 deletion packages/botonic-cli/templates/nlu/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const resolveConfig = {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
alias: {
BotonicProject: path.resolve(__dirname, 'src'),
webchat: path.resolve(__dirname, 'src', 'webchat'),
react: path.resolve(__dirname, 'node_modules', 'react'),
'styled-components': path.resolve(
__dirname,
Expand Down Expand Up @@ -167,7 +168,7 @@ function botonicWebchatConfig(mode) {
mode: mode,
devtool: sourceMap(mode),
target: 'web',
entry: path.resolve(botonicPath, 'src', 'entry.js'),
entry: path.resolve(botonicPath, 'src', 'webchat-entry.js'),
module: {
rules: [babelLoaderConfig, fileLoaderConfig, stylesLoaderConfig],
},
Expand Down
3 changes: 2 additions & 1 deletion packages/botonic-cli/templates/tutorial/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const resolveConfig = {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
alias: {
BotonicProject: path.resolve(__dirname, 'src'),
webchat: path.resolve(__dirname, 'src', 'webchat'),
react: path.resolve(__dirname, 'node_modules', 'react'),
'styled-components': path.resolve(
__dirname,
Expand Down Expand Up @@ -167,7 +168,7 @@ function botonicWebchatConfig(mode) {
mode: mode,
devtool: sourceMap(mode),
target: 'web',
entry: path.resolve(botonicPath, 'src', 'entry.js'),
entry: path.resolve(botonicPath, 'src', 'webchat-entry.js'),
module: {
rules: [babelLoaderConfig, fileLoaderConfig, stylesLoaderConfig],
},
Expand Down
5 changes: 5 additions & 0 deletions packages/botonic-react/src/webchat-entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WebchatApp } from './webchat-app'
// eslint-disable-next-line import/no-unresolved,node/no-missing-import
import { webchat } from 'webchat'

export const app = new WebchatApp(webchat)

0 comments on commit 36ea33c

Please sign in to comment.