2020-02-16 12:30:25 +01:00
|
|
|
/* global __dirname, module, process */
|
2022-05-05 07:03:23 +02:00
|
|
|
const TerserPlugin = require("terser-webpack-plugin");
|
2018-05-24 21:09:33 +02:00
|
|
|
const path = require('path');
|
2020-12-29 12:52:53 +01:00
|
|
|
|
2021-03-19 12:37:51 +01:00
|
|
|
let bootstrap_ignore_modules = ['carousel', 'scrollspy', 'tooltip', 'toast'];
|
2018-05-24 21:09:33 +02:00
|
|
|
|
2021-11-14 22:42:33 +01:00
|
|
|
|
2020-02-16 12:30:25 +01:00
|
|
|
const BOOTSTRAP_IGNORE_MODULES = (process.env.BOOTSTRAP_IGNORE_MODULES || '').replace(/ /g, '').trim();
|
|
|
|
if (BOOTSTRAP_IGNORE_MODULES.length > 0) {
|
2020-02-11 09:53:37 +01:00
|
|
|
bootstrap_ignore_modules = bootstrap_ignore_modules.concat(BOOTSTRAP_IGNORE_MODULES.split(','));
|
2020-02-16 12:30:25 +01:00
|
|
|
}
|
2020-02-11 09:53:37 +01:00
|
|
|
|
2019-09-11 17:18:11 +02:00
|
|
|
module.exports = {
|
2019-09-11 17:08:20 +02:00
|
|
|
output: {
|
2022-01-27 12:07:52 +01:00
|
|
|
path: path.resolve(__dirname, '../dist'), // Output path for generated bundles
|
2019-09-11 17:08:20 +02:00
|
|
|
chunkFilename: '[name].js'
|
|
|
|
},
|
2022-05-05 07:03:23 +02:00
|
|
|
devtool: "source-map",
|
|
|
|
optimization: {
|
|
|
|
minimize: true,
|
|
|
|
minimizer: [
|
|
|
|
new TerserPlugin({
|
|
|
|
include: /\.min\.js$/
|
|
|
|
})
|
|
|
|
],
|
|
|
|
},
|
2018-05-24 21:09:33 +02:00
|
|
|
externals: [{
|
|
|
|
"window": "window"
|
|
|
|
}],
|
2019-09-04 18:58:10 +02:00
|
|
|
watchOptions: {
|
2021-04-14 22:56:59 +02:00
|
|
|
ignored: /dist/,
|
2019-09-04 18:58:10 +02:00
|
|
|
},
|
2018-05-24 21:09:33 +02:00
|
|
|
module: {
|
2018-06-02 17:18:42 +02:00
|
|
|
rules: [
|
|
|
|
{
|
2022-01-08 02:31:43 +01:00
|
|
|
test: /LC_MESSAGES[\\/]converse.po$/,
|
2019-08-23 10:41:28 +02:00
|
|
|
type: "json",
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'po-loader',
|
|
|
|
options: {
|
|
|
|
'format': 'jed',
|
|
|
|
'domain': 'converse'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-08-09 23:36:19 +02:00
|
|
|
}, {
|
2022-01-08 02:31:43 +01:00
|
|
|
test: /webfonts[\\/].*\.(woff(2)?|ttf|eot|truetype|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
2022-05-04 20:30:51 +02:00
|
|
|
type: 'asset/resource',
|
|
|
|
generator: {
|
|
|
|
filename: '[name][ext]',
|
|
|
|
publicPath: 'webfonts/',
|
|
|
|
outputPath: 'webfonts/'
|
2019-04-18 16:56:27 +02:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
test: /\.scss$/,
|
|
|
|
use: [
|
|
|
|
'style-loader',
|
2019-08-23 13:19:05 +02:00
|
|
|
{
|
2019-04-18 16:56:27 +02:00
|
|
|
loader: 'css-loader',
|
|
|
|
options: {
|
|
|
|
sourceMap: true
|
|
|
|
}
|
2019-09-02 17:25:20 +02:00
|
|
|
},
|
|
|
|
'postcss-loader',
|
|
|
|
{
|
2019-04-18 16:56:27 +02:00
|
|
|
loader: 'sass-loader',
|
|
|
|
options: {
|
2020-04-07 14:08:01 +02:00
|
|
|
sassOptions: {
|
2021-03-19 11:36:19 +01:00
|
|
|
includePaths: [
|
2022-01-27 12:07:52 +01:00
|
|
|
path.resolve(__dirname, '../node_modules/'),
|
|
|
|
path.resolve(__dirname, '../src/')
|
2021-03-19 11:36:19 +01:00
|
|
|
]
|
2020-04-07 14:08:01 +02:00
|
|
|
},
|
2019-08-23 13:19:05 +02:00
|
|
|
sourceMap: true
|
|
|
|
}
|
2019-04-18 16:56:27 +02:00
|
|
|
}
|
2019-08-23 13:19:05 +02:00
|
|
|
]
|
2018-05-24 21:09:33 +02:00
|
|
|
}, {
|
|
|
|
test: /\.js$/,
|
2021-04-29 10:38:17 +02:00
|
|
|
include: [
|
|
|
|
/src/,
|
|
|
|
/node_modules\/mergebounce/,
|
2021-04-14 22:56:59 +02:00
|
|
|
/node_modules\/lit-html/,
|
|
|
|
/node_modules\/strophe/,
|
2021-05-12 11:07:38 +02:00
|
|
|
/node_modules\/pluggable/,
|
|
|
|
/node_modules\/@converse/,
|
2021-04-29 10:38:17 +02:00
|
|
|
],
|
2018-05-24 21:09:33 +02:00
|
|
|
use: {
|
2022-08-09 11:41:08 +02:00
|
|
|
loader: 'babel-loader'
|
2018-05-24 21:09:33 +02:00
|
|
|
}
|
2019-01-25 07:28:28 +01:00
|
|
|
}, {
|
|
|
|
test: /bootstrap\.native/,
|
|
|
|
use: {
|
|
|
|
loader: 'bootstrap.native-loader',
|
|
|
|
options: {
|
2019-04-18 14:56:35 +02:00
|
|
|
bs_version: 4,
|
2020-02-11 09:53:37 +01:00
|
|
|
ignore: bootstrap_ignore_modules
|
2019-01-25 07:28:28 +01:00
|
|
|
}
|
|
|
|
}
|
2018-05-24 21:09:33 +02:00
|
|
|
}],
|
|
|
|
},
|
|
|
|
resolve: {
|
2018-06-06 11:04:23 +02:00
|
|
|
extensions: ['.js'],
|
2018-05-24 21:09:33 +02:00
|
|
|
modules: [
|
|
|
|
'node_modules',
|
2022-01-27 12:07:52 +01:00
|
|
|
path.resolve(__dirname, "../src")
|
2018-05-24 21:09:33 +02:00
|
|
|
],
|
|
|
|
alias: {
|
2022-01-27 12:07:52 +01:00
|
|
|
"IPv6": path.resolve(__dirname, "../node_modules/urijs/src/IPv6"),
|
|
|
|
"SecondLevelDomains": path.resolve(__dirname, "../node_modules/urijs/src/SecondLevelDomains"),
|
|
|
|
"formdata-polyfill": path.resolve(__dirname, "../node_modules/formdata-polyfill/FormData"),
|
2022-04-28 23:46:12 +02:00
|
|
|
"punycode": path.resolve(__dirname, "../node_modules/urijs/src/punycode"),
|
2022-06-20 21:04:42 +02:00
|
|
|
"./shims": path.resolve(__dirname, "../src/strophe-shims.js"),
|
2018-05-24 21:09:33 +02:00
|
|
|
}
|
|
|
|
}
|
2022-04-28 23:46:12 +02:00
|
|
|
|
2018-05-24 21:09:33 +02:00
|
|
|
}
|