Skip to content

Commit 5158b52

Browse files
EEParkerrstoenescu
authored andcommitted
fix(devserver) Remove "prod" requirement for using publicPath (quasarframework#4962)
* add option to force publicPath in 'dev' builds * Update quasar-conf-js.md
1 parent fccc570 commit 5158b52

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/quasar-config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ class QuasarConfig {
376376
webpackManifest: this.ctx.prod,
377377
vueRouterMode: 'hash',
378378
preloadChunks: true,
379+
forceDevPublicPath: false,
379380
// transpileDependencies: [], // leaving here for completeness
380381
devtool: this.ctx.dev
381382
? '#cheap-module-eval-source-map'
@@ -474,7 +475,7 @@ class QuasarConfig {
474475
}
475476

476477
cfg.build.publicPath =
477-
this.ctx.prod && cfg.build.publicPath && ['spa', 'pwa'].includes(this.ctx.modeName)
478+
(this.ctx.prod || cfg.build.forceDevPublicPath) && cfg.build.publicPath && ['spa', 'pwa'].includes(this.ctx.modeName)
478479
? formatPublicPath(cfg.build.publicPath)
479480
: (cfg.build.vueRouterMode !== 'hash' ? '/' : '')
480481

@@ -711,7 +712,7 @@ class QuasarConfig {
711712
}
712713
}
713714
else {
714-
cfg.build.env.__statics = `"${this.ctx.dev ? '/' : cfg.build.publicPath || '/'}statics"`
715+
cfg.build.env.__statics = `"${((this.ctx.prod || cfg.build.forceDevPublicPath) && cfg.build.publicPath) ? cfg.build.publicPath : '/' }statics"`
715716
}
716717

717718
appFilesValidations(cfg)

0 commit comments

Comments
 (0)