fix: routerBasename setting (#4891)

This commit is contained in:
Bill Wallace authored and GitHub committed 2025-03-27 16:47:16 -04:00
1 parent c368d763b0
commit 459b0d223a
40 files changed
+299 -229

No files matched your search

+6
View File
@@ -153,6 +153,12 @@ module.exports = (env, argv) => {
},
proxy: {
'/dicomweb': 'http://localhost:5000',
'/dicom-microscopy-viewer': {
target: 'http://localhost:3000',
pathRewrite: {
'^/dicom-microscopy-viewer': `/${PUBLIC_URL}/dicom-microscopy-viewer`,
},
},
},
static: [
{
@@ -1,7 +1,6 @@
const pluginConfig = require('../pluginConfig.json');
const fs = require('fs');
const os = require('os');
const glob = require('glob');
const autogenerationDisclaimer = `
// THIS FILE IS AUTOGENERATED AS PART OF THE EXTENSION AND MODE PLUGIN PROCESS.
@@ -9,6 +8,12 @@ const autogenerationDisclaimer = `
const extractName = val => (typeof val === 'string' ? val : val.packageName);
const publicURL = process.env.PUBLIC_URL || '/';
function isAbsolutePath(path) {
return path.startsWith('http') || path.startsWith('/');
}
function constructLines(input, categoryName) {
let pluginCount = 0;
@@ -72,7 +77,7 @@ function getRuntimeLoadModesExtensions(modules) {
if (module.importPath) {
dynamicLoad.push(
` if( module==="${packageName}") {`,
` const imported = await window.browserImportFunction('${module.importPath}');`,
` const imported = await window.browserImportFunction('${isAbsolutePath(module.importPath) ? '' : publicURL}${module.importPath}');`,
' return ' +
(module.globalName
? `window["${module.globalName}"];`