Files
mcb-platform-monorepo/services/msb-host/webpack.config.ts
T

106 lines
3.1 KiB
TypeScript

import type { IWebpackAppConfig } from '@msb/mf-builder';
import CopyPlugin from 'copy-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import webpack from 'webpack';
import path from 'node:path';
import packageJson from './package.json';
const outputPath = path.resolve(__dirname, '../../msb-host');
const publicPath = path.resolve(__dirname, 'public');
const config: IWebpackAppConfig = {
moduleName: packageJson.name,
paths: {
outputPath,
publicUrl: '/msb-host/',
},
devServerOptions: {
port: 8000,
proxy: [
{
context: ['/msb-host'],
target: '/',
changeOrigin: true,
pathRewrite: { '/msb-host': '' },
},
{
context: ['/msb-main-page'],
target: 'http://localhost:3002 ',
changeOrigin: true,
pathRewrite: { '/msb-main-page': '' },
},
{
context: ['/msb-operations-history'],
target: 'http://localhost:3003',
changeOrigin: true,
pathRewrite: { '/msb-operations-history': '' },
},
{
context: ['/msb-deposits'],
target: 'http://localhost:3007',
changeOrigin: true,
pathRewrite: { '/msb-deposits': '' },
},
{
context: ['/msb-payments'],
target: 'http://localhost:3004',
changeOrigin: true,
pathRewrite: { '/msb-payments': '' },
},
{
context: ['/msb-statements-and-inquiries'],
target: 'http://localhost:3005',
changeOrigin: true,
pathRewrite: { '/msb-statements-and-inquiries': '' },
},
{
context: ['/msb-fea'],
target: 'http://localhost:3008',
changeOrigin: true,
pathRewrite: { '/msb-fea': '' },
},
{
context: ['/msb-partner-check'],
target: 'http://localhost:3009',
changeOrigin: true,
pathRewrite: { '/msb-partner-check': '' },
},
{ context: ['/msb-accounts'], target: 'http://localhost:3006', changeOrigin: true, pathRewrite: { '/msb-accounts': '' } },
{ context: ['/msb-business-cards'], target: 'http://localhost:3011', changeOrigin: true, pathRewrite: { '/msb-business-cards': '' } },
{ context: ['/msb-treasury-deals'], target: 'http://localhost:3010', changeOrigin: true, pathRewrite: { '/msb-treasury-deals': '' } },
{
context: ['/api', '/.well-known'],
target: 'https://client.stage.gboteam.ru',
changeOrigin: true,
pathRewrite: { 'https://client.stage.gboteam.ru': '' },
},
],
},
plugins: [
new webpack.DefinePlugin({ 'process.env.IB_MODULE_VERSION': JSON.stringify(process.env.IB_MODULE_VERSION) }),
new HtmlWebpackPlugin({
template: path.resolve(publicPath, 'index.html'),
filename: 'index.html',
favicon: path.resolve(publicPath, 'favicon.ico'),
hash: true,
cache: true,
}),
new CopyPlugin({
patterns: [
{
context: publicPath,
from: '**/*.(json|css)',
to: outputPath,
},
{
context: publicPath,
from: '**/*.(png|jpg|jpeg|webp|svg)',
to: outputPath,
},
],
}),
],
};
export default config;