Skip to content

Commit 48ed976

Browse files
authored
fix: publicPath with 'auto' value. (#267)
1 parent 7b38e6c commit 48ed976

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/plugins/pluginMFManifest.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const Manifest = (): Plugin[] => {
2828
let remoteEntryFile: string;
2929
let publicPath: string;
3030
let _command: string;
31+
let _originalConfigBase: string | undefined;
3132
let viteConfig: any;
3233
return [
3334
{
@@ -85,6 +86,7 @@ const Manifest = (): Plugin[] => {
8586
if (!config.build.manifest)
8687
config.build.manifest = config.build.manifest || !!manifestOptions;
8788
_command = command;
89+
_originalConfigBase = config.base;
8890
},
8991
configResolved(config) {
9092
root = config.root;
@@ -101,7 +103,8 @@ const Manifest = (): Plugin[] => {
101103
if (_command === 'serve') {
102104
base = (config.server.origin || '') + config.base;
103105
}
104-
publicPath = base ? base.replace(/\/?$/, '/') : 'auto';
106+
publicPath =
107+
_originalConfigBase === '' ? 'auto' : base ? base.replace(/\/?$/, '/') : 'auto';
105108
},
106109
async generateBundle(options, bundle) {
107110
if (!mfManifestName) return;

0 commit comments

Comments
 (0)