File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -195,16 +195,6 @@ export async function preview(
195195
196196 setupSIGTERMListener ( closeServerAndExit )
197197
198- // apply server hooks from plugins
199- const configurePreviewServerContext = new BasicMinimalPluginContext (
200- { ...basePluginContextMeta , watchMode : false } ,
201- config . logger ,
202- )
203- const postHooks : ( ( ( ) => void ) | void ) [ ] = [ ]
204- for ( const hook of config . getSortedPluginHooks ( 'configurePreviewServer' ) ) {
205- postHooks . push ( await hook . call ( configurePreviewServerContext , server ) )
206- }
207-
208198 // cors
209199 const { cors } = config . preview
210200 if ( cors !== false ) {
@@ -218,6 +208,16 @@ export async function preview(
218208 app . use ( hostValidationMiddleware ( allowedHosts , true ) )
219209 }
220210
211+ // apply server hooks from plugins
212+ const configurePreviewServerContext = new BasicMinimalPluginContext (
213+ { ...basePluginContextMeta , watchMode : false } ,
214+ config . logger ,
215+ )
216+ const postHooks : ( ( ( ) => void ) | void ) [ ] = [ ]
217+ for ( const hook of config . getSortedPluginHooks ( 'configurePreviewServer' ) ) {
218+ postHooks . push ( await hook . call ( configurePreviewServerContext , server ) )
219+ }
220+
221221 // proxy
222222 const { proxy } = config . preview
223223 if ( proxy ) {
You can’t perform that action at this time.
0 commit comments