2019-08-23 17:09:39 +02:00
|
|
|
/* global module, __dirname */
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
const common = require("./webpack.common.js");
|
|
|
|
const path = require('path');
|
2020-08-16 22:53:24 +02:00
|
|
|
const { merge} = require("webpack-merge");
|
2019-08-23 17:09:39 +02:00
|
|
|
|
|
|
|
module.exports = merge(common, {
|
|
|
|
mode: "production",
|
|
|
|
output: {
|
|
|
|
filename: 'converse-no-dependencies.js'
|
|
|
|
},
|
|
|
|
optimization: {
|
|
|
|
minimizer: []
|
|
|
|
},
|
|
|
|
plugins: [
|
2021-06-25 10:38:38 +02:00
|
|
|
new MiniCssExtractPlugin({filename: 'tmp.css'})
|
2019-08-23 17:09:39 +02:00
|
|
|
],
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
2021-03-17 09:34:00 +01:00
|
|
|
include: /src/,
|
2019-08-23 17:09:39 +02:00
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: [
|
|
|
|
["@babel/preset-env", {
|
|
|
|
"targets": {
|
2021-03-17 09:34:00 +01:00
|
|
|
"browsers": ["ie 11"]
|
2019-08-23 17:09:39 +02:00
|
|
|
}
|
|
|
|
}]
|
2021-03-17 09:34:00 +01:00
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
'@babel/plugin-proposal-class-properties',
|
|
|
|
'@babel/plugin-proposal-nullish-coalescing-operator',
|
|
|
|
'@babel/plugin-proposal-optional-chaining',
|
|
|
|
'@babel/plugin-syntax-dynamic-import'
|
2019-08-23 17:09:39 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
|
|
|
use: [
|
|
|
|
MiniCssExtractPlugin.loader,
|
|
|
|
'css-loader',
|
|
|
|
{
|
|
|
|
loader: 'sass-loader',
|
|
|
|
options: {
|
2020-04-13 11:45:02 +02:00
|
|
|
sassOptions: {
|
|
|
|
includePaths: [path.resolve(__dirname, 'node_modules/')]
|
|
|
|
}
|
2019-08-23 17:09:39 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
externals: [{
|
2021-03-17 09:34:00 +01:00
|
|
|
'pluggable.js': 'pluggable',
|
|
|
|
'@converse/skeletor': 'skeletor',
|
|
|
|
'localforage': 'localforage',
|
|
|
|
'filesize': 'filesize',
|
|
|
|
'jed': 'jed',
|
|
|
|
'lodash': 'lodash',
|
|
|
|
'lodash.noconflict': 'lodash.noconflict',
|
|
|
|
'sizzle': 'sizzle',
|
|
|
|
'strophe.js': 'strophe',
|
|
|
|
'twemoji': 'twemoji',
|
|
|
|
'urijs': 'urijs',
|
|
|
|
'window': 'window',
|
2019-08-23 17:09:39 +02:00
|
|
|
}]
|
|
|
|
});
|