Add release runtime bootstrap implementation with unit and E2E tests
- Create `releaseBootstrap.js` service to handle runtime configuration and remote frontend loading. - Integrate runtime-aware API URL resolution across components and services. - Update i18n phrases to clarify new domains for `ssl_domain_message`. - Enhance unit and E2E tests to validate runtime-based frontend loading and fallback behavior. - Refactor session-related API calls and incorporate runtime-configured base URLs.
This commit is contained in:
@@ -64,6 +64,36 @@ function patchBuefyCssMediaQuery() {
|
||||
}
|
||||
}
|
||||
|
||||
function releaseEntryManifest() {
|
||||
return {
|
||||
name: 'release-entry-manifest',
|
||||
generateBundle(_, bundle) {
|
||||
const chunks = Object.values(bundle).filter((item) => item.type === 'chunk')
|
||||
const mainChunk = chunks.find((chunk) =>
|
||||
String(chunk.facadeModuleId || '').replace(/\\/g, '/').endsWith('/src/main.js')
|
||||
) || chunks.find((chunk) => chunk.name === 'main' && /^assets\/main-[\w-]+\.js$/.test(chunk.fileName))
|
||||
if (!mainChunk) {
|
||||
this.warn('Could not find src/main.js chunk for release-entry.json')
|
||||
return
|
||||
}
|
||||
|
||||
const css = Array.from(mainChunk.viteMetadata?.importedCss || [])
|
||||
this.emitFile({
|
||||
type: 'asset',
|
||||
fileName: 'release-entry.json',
|
||||
source: JSON.stringify(
|
||||
{
|
||||
entry: mainChunk.fileName,
|
||||
css
|
||||
},
|
||||
null,
|
||||
2
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const isProd = mode === 'production'
|
||||
const isPlaywrightRuntime = process.env.PLAYWRIGHT === '1'
|
||||
@@ -107,6 +137,7 @@ export default defineConfig(({ mode }) => {
|
||||
patchBuefyCssMediaQuery(),
|
||||
vue(),
|
||||
VueJsx(),
|
||||
releaseEntryManifest(),
|
||||
!isProd && !isPlaywrightRuntime && vueDevTools(),
|
||||
enableSingleFile && viteSingleFile(),
|
||||
VitePWA({
|
||||
|
||||
Reference in New Issue
Block a user