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(
195
195
196
196
setupSIGTERMListener ( closeServerAndExit )
197
197
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
-
208
198
// cors
209
199
const { cors } = config . preview
210
200
if ( cors !== false ) {
@@ -218,6 +208,16 @@ export async function preview(
218
208
app . use ( hostValidationMiddleware ( allowedHosts , true ) )
219
209
}
220
210
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
+
221
221
// proxy
222
222
const { proxy } = config . preview
223
223
if ( proxy ) {
You can’t perform that action at this time.
0 commit comments