Files
nym/nym-wallet/webpack.common.js
T
Mark Sinclair e271370326 Split wallet sign in and main into two entry points
Stash some of the state in the Rust process and load it when the React app mounts
Fix connect_with_mnemonic logging
2023-04-24 12:24:19 +01:00

34 lines
1.2 KiB
JavaScript

const path = require('path');
const { mergeWithRules } = require('webpack-merge');
const { webpackCommon } = require('@nymproject/webpack');
const entry = {
auth: path.resolve(__dirname, 'src/auth.tsx'), // JS bundle for sign up/sign in
main: path.resolve(__dirname, 'src/main.tsx'), // JS bundle for main app
log: path.resolve(__dirname, 'src/log.tsx'), // JS bundle for logging window
};
module.exports = mergeWithRules({
module: {
rules: {
test: 'match',
use: 'replace',
},
},
})(
webpackCommon(__dirname, [
{ filename: 'index.html', chunks: ['auth'], template: path.resolve(__dirname, 'public/index.html') }, // the starting point is index.html (sign up/sign in)
{ filename: 'main.html', chunks: ['main'], template: path.resolve(__dirname, 'public/index.html') }, // main app (loaded after sign in in a new window)
{ filename: 'log.html', chunks: ['log'], template: path.resolve(__dirname, 'public/log.html') }, // the user can open a separate logging window
]),
{
entry,
output: {
clean: true,
path: path.resolve(__dirname, 'dist'),
filename: '[name].bundle.js',
publicPath: '/',
},
},
);