fix: routerBasename setting (#4891)
This commit is contained in:
1 parent
c368d763b0
commit
459b0d223a
40 files changed
+299
-229
No files matched your search
@@ -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}"];`
|
||||
|
||||
Reference in new issue
Block a user