forked from Chatbot/v3-api
41 lines
834 B
JavaScript
41 lines
834 B
JavaScript
const path = require('path');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
module.exports = {
|
|
entry: {
|
|
main: './src/index.tsx',
|
|
widget: './src/widget/widget-entry.tsx'
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: '[name].js',
|
|
publicPath: '/'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(ts|tsx)$/,
|
|
use: 'ts-loader',
|
|
exclude: /node_modules/
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ['style-loader', 'css-loader']
|
|
}
|
|
]
|
|
},
|
|
resolve: {
|
|
extensions: ['.tsx', '.ts', '.js']
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: './public/index.html',
|
|
chunks: ['main']
|
|
}),
|
|
new HtmlWebpackPlugin({
|
|
filename: 'widget.html',
|
|
template: './public/widget.html',
|
|
chunks: ['widget']
|
|
})
|
|
]
|
|
};
|