Log in with external Peertube account (#348):
* For anonymous users: new "log in using an external account" dialog, with the "remote Peertube account" options * ConverseJS: using global vars for custom localized string (injected using Webpack)
This commit is contained in:
@ -1,18 +1,54 @@
|
||||
const prod = require('./webpack/webpack.build.js')
|
||||
const { merge } = require('webpack-merge')
|
||||
const webpack = require('webpack')
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const locKeys = require('./loc.keys.js')
|
||||
|
||||
function loadLocs () {
|
||||
// Loading english strings, so we can inject them as constants.
|
||||
const refFile = path.resolve(__dirname, '..', '..', 'dist', 'languages', 'en.reference.json')
|
||||
if (!fs.existsSync(refFile)) {
|
||||
throw new Error('Missing english reference file, please run "npm run build:languages" before building ConverseJS')
|
||||
}
|
||||
const english = require(refFile)
|
||||
|
||||
const r = {}
|
||||
for (const key of locKeys) {
|
||||
if (!(key in english) || (typeof english[key] !== 'string')) {
|
||||
throw new Error('Missing english string key=' + key)
|
||||
}
|
||||
r['LOC_' + key] = JSON.stringify(english[key])
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
module.exports = merge(prod, {
|
||||
entry: path.resolve(__dirname, 'custom/entry.js'),
|
||||
output: {
|
||||
filename: 'converse.min.js'
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin(loadLocs())
|
||||
],
|
||||
resolve: {
|
||||
extensions: ['.js'],
|
||||
alias: {
|
||||
'./templates/muc-bottom-panel.js': path.resolve('custom/templates/muc-bottom-panel.js'),
|
||||
'../../templates/background_logo.js$': path.resolve(__dirname, 'custom/templates/background_logo.js'),
|
||||
'shared/styles/index.scss$': path.resolve(__dirname, 'custom/shared/styles/livechat.scss')
|
||||
'shared/styles/index.scss$': path.resolve(__dirname, 'custom/shared/styles/livechat.scss'),
|
||||
'shared/modals/livechat-external-login.js': path.resolve(
|
||||
__dirname,
|
||||
'custom/shared/modals/livechat-external-login.js'
|
||||
),
|
||||
'templates/livechat-external-login-modal.js': path.resolve(
|
||||
__dirname,
|
||||
'custom/templates/livechat-external-login-modal.js'
|
||||
),
|
||||
'livechat-external-login-content.js': path.resolve(
|
||||
__dirname,
|
||||
'custom/livechat-external-login-content.js'
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user