2020-02-16 12:30:25 +01:00
|
|
|
/* global __dirname, module, process */
|
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
|
|
|
|
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: {
|
|
|
|
path: path.resolve(__dirname, 'dist'), // Output path for generated bundles
|
|
|
|
chunkFilename: '[name].js'
|
|
|
|
},
|
2019-10-06 12:48:05 +02:00
|
|
|
entry: path.resolve(__dirname, 'src/entry.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: [
|
|
|
|
{
|
|
|
|
test: path.resolve(__dirname, "node_modules/xss/dist/xss"),
|
2021-07-15 13:24:46 +02:00
|
|
|
use: "exports-loader?filterXSS"
|
2019-08-23 10:41:28 +02:00
|
|
|
}, {
|
|
|
|
test: /LC_MESSAGES\/converse.po$/,
|
|
|
|
type: "json",
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'po-loader',
|
|
|
|
options: {
|
|
|
|
'format': 'jed',
|
|
|
|
'domain': 'converse'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-08-09 23:36:19 +02:00
|
|
|
}, {
|
2019-04-18 16:56:27 +02:00
|
|
|
test: /webfonts\/.*\.(woff(2)?|ttf|eot|truetype|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'file-loader',
|
|
|
|
options: {
|
2019-08-12 13:00:09 +02:00
|
|
|
name: '[name].[ext]',
|
|
|
|
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: [
|
|
|
|
path.resolve(__dirname, 'node_modules/'),
|
|
|
|
path.resolve(__dirname, 'src/')
|
|
|
|
]
|
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: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: [
|
|
|
|
["@babel/preset-env", {
|
|
|
|
"targets": {
|
2021-01-04 14:10:43 +01:00
|
|
|
"browsers": [">1%", "not ie 11", "not op_mini all", "not dead"]
|
2018-05-24 21:09:33 +02:00
|
|
|
}
|
|
|
|
}]
|
2019-09-02 17:25:20 +02:00
|
|
|
],
|
2021-06-29 16:15:06 +02:00
|
|
|
plugins: []
|
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',
|
2018-06-06 11:04:23 +02:00
|
|
|
path.resolve(__dirname, "src")
|
2018-05-24 21:09:33 +02:00
|
|
|
],
|
|
|
|
alias: {
|
|
|
|
"IPv6": path.resolve(__dirname, "node_modules/urijs/src/IPv6"),
|
|
|
|
"SecondLevelDomains": path.resolve(__dirname, "node_modules/urijs/src/SecondLevelDomains"),
|
2018-09-25 13:19:26 +02:00
|
|
|
"formdata-polyfill": path.resolve(__dirname, "node_modules/formdata-polyfill/FormData"),
|
2020-01-30 12:57:11 +01:00
|
|
|
"punycode": path.resolve(__dirname, "node_modules/urijs/src/punycode")
|
2018-05-24 21:09:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|