@@ -94,10 +94,6 @@ export const createCommonRoutes = ({
94
94
target : `http://localhost:${ process . env . CYPRESS_INTERNAL_VITE_APP_PORT } /` ,
95
95
} )
96
96
97
- router . get ( '/__vite__/' , ( req , res ) => {
98
- ctx . html . appHtml ( ) . then ( ( html ) => res . send ( html ) ) . catch ( ( e ) => res . status ( 500 ) . send ( { stack : e . stack } ) )
99
- } )
100
-
101
97
// TODO: can namespace this onto a "unified" route like __app-unified__
102
98
// make sure to update the generated routes inside of vite.config.ts
103
99
router . get ( '/__vite__/*' , ( req , res ) => {
@@ -146,15 +142,32 @@ export const createCommonRoutes = ({
146
142
router . get ( clientRoute , ( req , res ) => {
147
143
debug ( 'Serving Cypress front-end by requested URL:' , req . url )
148
144
149
- runner . serve ( req , res , testingType === 'e2e' ? 'runner' : 'runner-ct' , {
150
- config,
151
- testingType,
152
- getSpec,
153
- getCurrentBrowser,
154
- getRemoteState,
155
- specsStore,
156
- exit,
157
- } )
145
+ if ( process . env . LAUNCHPAD ) {
146
+ ctx . html . appHtml ( )
147
+ . then ( ( html ) => res . send ( html ) )
148
+ . catch ( ( e ) => res . status ( 500 ) . send ( { stack : e . stack } ) )
149
+ } else {
150
+ runner . serve ( req , res , testingType === 'e2e' ? 'runner' : 'runner-ct' , {
151
+ config,
152
+ testingType,
153
+ getSpec,
154
+ getCurrentBrowser,
155
+ getRemoteState,
156
+ specsStore,
157
+ exit,
158
+ } )
159
+ }
160
+ } )
161
+
162
+ // serve static assets from the dist'd Vite app
163
+ router . get ( [
164
+ `${ clientRoute } assets/*` ,
165
+ `${ clientRoute } shiki/*` ,
166
+ ] , ( req , res ) => {
167
+ debug ( 'proxying static assets %s, params[0] %s' , req . url , req . params [ 0 ] )
168
+ const pathToFile = getPathToDist ( 'app' , 'assets' , req . params [ 0 ] )
169
+
170
+ return send ( req , pathToFile ) . pipe ( res )
158
171
} )
159
172
160
173
router . all ( '*' , ( req , res ) => {
0 commit comments