Adding custom webpack file for ConverseJS.

This commit is contained in:
John Livingston 2021-11-08 19:06:53 +01:00
parent b0eadd577d
commit 9e640dd5bc
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
3 changed files with 30 additions and 2 deletions

View File

@ -5,6 +5,7 @@
### Features
* Brand new documentation, in french and english. (Work in Progress)
* UI/UX improvements. Now using a custom ConverseJS build.
### Minor changes and fixes

View File

@ -28,9 +28,23 @@ else
cp -R $converse_src_dir/* "$converse_build_dir"
fi
echo "Building ConverseJS"
echo "Removing existing custom files...\n"
rm -rf "$converse_build_dir/custom/"
echo "Adding the custom files...\n"
cp -r "$src_dir/custom/" "$converse_build_dir/custom/"
mv "$converse_build_dir/custom/webpack.livechat.js" "$converse_build_dir/"
if [[ ! -d "$converse_build_dir/node_modules" ]]; then
echo "Missing node_modules directory, seems we have to call the makefile...\n"
cd "$converse_build_dir"
make node_modules src/*
cd $rootdir
fi
echo "Building ConverseJS...\n"
cd "$converse_build_dir"
make dist
npx webpack --config webpack.livechat.js
cd $rootdir
echo "Copying ConverseJS dist files...\n"

View File

@ -0,0 +1,13 @@
const prod = require('./webpack.prod.js')
const { merge } = require('webpack-merge')
// const path = require('path')
module.exports = merge(prod, {
resolve: {
extensions: ['.js'],
alias: {
// To override a template, use this syntax:
// 'templates/muc_sidebar.js': path.resolve(__dirname, 'custom/templates/muc_sidebar.js')
}
}
})