@moveo-ai/web-widget
Version:
Client side library to load the moveo chat widget and connect it with your agent
68 lines (63 loc) • 1.56 kB
JavaScript
const path = require('path');
const webpack = require('webpack');
const PrettierPlugin = require('prettier-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const pkg = require('./package.json');
const { version, name, author } = pkg;
const banner = `
${name} v${version}
Copyright (c) ${author.replace(/ *<[^)]*> */g, ' ')}
`;
module.exports = {
entry: path.resolve(__dirname, 'src/index.js'),
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'web-widget.js',
library: 'MoveoAI',
libraryTarget: 'umd',
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/,
use: ['url-loader'],
},
],
},
plugins: [
new CleanWebpackPlugin(),
new PrettierPlugin(),
new webpack.BannerPlugin(banner),
new HtmlWebpackPlugin({
inject: false,
title: 'Development',
}),
],
resolve: {
extensions: ['.js', '.css', '.svg'],
modules: ['node_modules'],
},
mode: 'development',
devtool: 'inline-source-map',
devServer: {
contentBase: path.resolve(__dirname, 'dist'),
compress: false,
port: 5000,
open: true,
},
};