arm-core/web/rsbuild.config.ts
Andrey Epifancev 99252d7a85 fix(web): синхронизация встроенного фронта с arm-web@test (025233f) (#115)
Перенесён диапазон arm-web 100fbfb..025233f (2 коммитов, 19 файлов набора
синхронизации) скриптом docs/scripts/sync-web.sh. После переноса web/ и
arm-web@test идентичны по набору. Коммиты arm-web:
- f868a92 Скан PDF с JBIG2 не рисовался: передать pdf.js wasmUrl и копировать wasm в сборку (#32)
- a8a6da0 Форматирование перед PR: ESLint + Prettier и npm run format (#29)

Co-Authored-By: sync-web.sh <noreply@aepif.ru>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 13:46:39 +04:00

39 lines
1.4 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig, loadEnv } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
const { publicVars, rawPublicVars } = loadEnv({prefixes: ['REACT_APP_']});
export default defineConfig({
server: {
base: (rawPublicVars['REACT_APP_ROOT_PATH'] !== undefined) ? rawPublicVars['REACT_APP_ROOT_PATH'] : '/',
proxy: {
// dev: запросы /api идут на arm-core с того же источника — без CORS, Content-Disposition читается (design D-5)
'/api': process.env.ARM_CORE_URL ?? 'http://localhost:8000',
},
},
output: {
// wasm-декодеры pdf.js (JBIG2, JPEG2000, ICC): без них скан не рисуется (AURORA-1635). Путь = PDFJS_WASM_DIR
copy: [{ from: 'node_modules/pdfjs-dist/wasm', to: 'static/pdfjs/wasm' }],
filename: {
js: '[name]_script.[contenthash:8].js',
css: '[name]_style.[contenthash:8].css',
},
distPath: {
favicon: 'static/image',
},
assetPrefix: (rawPublicVars['REACT_APP_ROOT_PATH'] !== undefined) ? rawPublicVars['REACT_APP_ROOT_PATH'] : './'
},
html: {
template: './public/index.html',
favicon: './src/assets/favicon.ico',
},
source: {
include: [{ not: /[\\/]core-js[\\/]/ }],
define: {
...publicVars,
'process.env': JSON.stringify(rawPublicVars),
}
},
plugins: [pluginReact()],
});