2021-09-04 11:28:47 +00:00
|
|
|
/* global __dirname */
|
|
|
|
const isProd = (process.env.NODE_ENV === 'production');
|
|
|
|
const path = require('path');
|
2017-05-03 16:42:26 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2021-09-05 12:05:06 +00:00
|
|
|
entry: ['./src/chat-messages.js'],
|
2017-05-03 16:42:26 +00:00
|
|
|
output: {
|
2021-09-04 11:28:47 +00:00
|
|
|
path: path.resolve(__dirname, 'dist'),
|
|
|
|
filename: 'build.js',
|
|
|
|
library: 'ChatMessages',
|
|
|
|
libraryTarget: 'umd',
|
2021-09-13 11:16:40 +00:00
|
|
|
libraryExport: 'default',
|
|
|
|
umdNamedDefine: true,
|
|
|
|
globalObject: 'this'
|
2017-05-03 16:42:26 +00:00
|
|
|
},
|
2021-09-04 11:28:47 +00:00
|
|
|
mode: isProd ? 'production' : 'development',
|
|
|
|
devtool: isProd ? 'source-map' : 'eval-source-map',
|
2017-05-03 16:42:26 +00:00
|
|
|
module: {
|
2021-09-04 11:28:47 +00:00
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: ['@babel/preset-env']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2017-05-03 16:42:26 +00:00
|
|
|
]
|
|
|
|
},
|
2021-09-04 11:28:47 +00:00
|
|
|
// plugins: plugins
|
2017-05-03 16:42:26 +00:00
|
|
|
};
|