@@ -285,27 +285,6 @@ export function createQwikPlugin(optimizerOptions: OptimizerOptions = {}) {
285
285
if ( updatedOpts . manifestInput ) {
286
286
opts . manifestInput = getValidManifest ( updatedOpts . manifestInput ) || null ;
287
287
}
288
- if (
289
- ! opts . manifestInput &&
290
- opts . target === 'ssr' &&
291
- opts . buildMode === 'production' &&
292
- maybeFs
293
- ) {
294
- let clientManifestPath = resolvePath ( opts . clientOutDir , Q_MANIFEST_FILENAME ) ;
295
- if ( ! ( await maybeFs . promises . stat ( clientManifestPath ) . catch ( ( ) => false ) ) ) {
296
- clientManifestPath = resolvePath ( opts . rootDir , CLIENT_OUT_DIR , Q_MANIFEST_FILENAME ) ;
297
- }
298
- try {
299
- const clientManifestStr = await maybeFs . promises . readFile ( clientManifestPath , 'utf-8' ) ;
300
- opts . manifestInput = getValidManifest ( JSON . parse ( clientManifestStr ) ) || null ;
301
- // eslint-disable-next-line no-console
302
- console . info ( 'Read client manifest from' , clientManifestPath ) ;
303
- } catch ( e ) {
304
- console . warn (
305
- `could not read Qwik client manifest ${ clientManifestPath } , ignoring. Make sure you provide it to the SSR renderer. (${ e } )`
306
- ) ;
307
- }
308
- }
309
288
310
289
if ( typeof updatedOpts . transformedModuleOutput === 'function' ) {
311
290
opts . transformedModuleOutput = updatedOpts . transformedModuleOutput ;
@@ -944,6 +923,29 @@ export const isDev = ${JSON.stringify(isDev)};
944
923
}
945
924
946
925
async function getQwikServerManifestModule ( isServer : boolean ) {
926
+ if (
927
+ ! opts . manifestInput &&
928
+ opts . target === 'ssr' &&
929
+ opts . buildMode === 'production' &&
930
+ maybeFs
931
+ ) {
932
+ const path = getPath ( ) ;
933
+ let clientManifestPath = path . resolve ( opts . clientOutDir , Q_MANIFEST_FILENAME ) ;
934
+ if ( ! ( await maybeFs . promises . stat ( clientManifestPath ) . catch ( ( ) => false ) ) ) {
935
+ clientManifestPath = path . resolve ( opts . rootDir , CLIENT_OUT_DIR , Q_MANIFEST_FILENAME ) ;
936
+ }
937
+ try {
938
+ const clientManifestStr = await maybeFs . promises . readFile ( clientManifestPath , 'utf-8' ) ;
939
+ opts . manifestInput = getValidManifest ( JSON . parse ( clientManifestStr ) ) || null ;
940
+ // eslint-disable-next-line no-console
941
+ console . info ( 'Read client manifest from' , clientManifestPath ) ;
942
+ } catch ( e ) {
943
+ console . warn (
944
+ `could not read Qwik client manifest ${ clientManifestPath } , ignoring. Make sure you provide it to the SSR renderer. (${ e } )`
945
+ ) ;
946
+ }
947
+ }
948
+
947
949
const manifest = isServer ? opts . manifestInput : null ;
948
950
let serverManifest : ServerQwikManifest | null = null ;
949
951
if ( manifest ?. manifestHash ) {
0 commit comments