1- import { clientViteManifest } from "solid-start:client-vite-manifest"
21import { join } from "pathe" ;
3- import type { Asset } from "../renderAsset.jsx" ;
2+ import { clientViteManifest } from "solid-start:client-vite-manifest" ;
3+ import { Manifest } from "vite" ;
44import { CLIENT_BASE_PATH } from "../../constants.js" ;
5+ import type { Asset } from "../renderAsset.jsx" ;
56
67// Only reads from client manifest atm, might need server support for islands
78export function getSsrProdManifest ( ) {
@@ -57,7 +58,7 @@ function createHtmlTagsForAssets(assets: string[]) {
5758 } ) ) ;
5859}
5960
60- function findAssetsInViteManifest ( manifest : any , id : string , assetMap = new Map ( ) , stack : string [ ] = [ ] ) {
61+ function findAssetsInViteManifest ( manifest : Manifest , id : string , assetMap = new Map ( ) , stack : string [ ] = [ ] ) {
6162 if ( stack . includes ( id ) ) {
6263 return [ ] ;
6364 }
@@ -72,13 +73,14 @@ function findAssetsInViteManifest(manifest: any, id: string, assetMap = new Map(
7273 }
7374
7475 const assets = [
75- ...( chunk . assets ?. filter ( Boolean ) || [ ] ) ,
76+ // TODO: Needs a better way to detect ?url
77+ ...( chunk . assets ?. filter ( a => ! a . endsWith ( '.css' ) ) || [ ] ) ,
7678 ...( chunk . css ?. filter ( Boolean ) || [ ] )
7779 ] ;
7880 if ( chunk . imports ) {
7981 stack . push ( id ) ;
8082 for ( let i = 0 , l = chunk . imports . length ; i < l ; i ++ ) {
81- assets . push ( ...findAssetsInViteManifest ( manifest , chunk . imports [ i ] , assetMap , stack ) ) ;
83+ assets . push ( ...findAssetsInViteManifest ( manifest , chunk . imports [ i ] ! , assetMap , stack ) ) ;
8284 }
8385 stack . pop ( ) ;
8486 }
0 commit comments