@@ -267,35 +267,6 @@ export class Application implements ServerApplication {
267
267
}
268
268
}
269
269
270
- private isScopedModule ( url : string ) {
271
- for ( const ext of moduleExts ) {
272
- if ( url . endsWith ( '.' + ext ) ) {
273
- if ( url . startsWith ( '/pages/' ) || url . startsWith ( '/api/' ) ) {
274
- return true
275
- }
276
- switch ( trimModuleExt ( url ) ) {
277
- case '/404' :
278
- case '/app' :
279
- return true
280
- }
281
- }
282
- }
283
-
284
- // is page module by plugin
285
- if ( this . config . plugins . some ( p => p . type === 'loader' && p . test . test ( url ) && p . allowPage ) ) {
286
- return true
287
- }
288
-
289
- // is dep
290
- for ( const { deps } of this . #modules. values ( ) ) {
291
- if ( deps . some ( dep => dep . url === url ) ) {
292
- return true
293
- }
294
- }
295
-
296
- return false
297
- }
298
-
299
270
get isDev ( ) {
300
271
return this . mode === 'development'
301
272
}
@@ -1249,6 +1220,35 @@ export class Application implements ServerApplication {
1249
1220
return ssr
1250
1221
}
1251
1222
1223
+ private isScopedModule ( url : string ) {
1224
+ for ( const ext of moduleExts ) {
1225
+ if ( url . endsWith ( '.' + ext ) ) {
1226
+ if ( url . startsWith ( '/pages/' ) || url . startsWith ( '/api/' ) ) {
1227
+ return true
1228
+ }
1229
+ switch ( trimModuleExt ( url ) ) {
1230
+ case '/404' :
1231
+ case '/app' :
1232
+ return true
1233
+ }
1234
+ }
1235
+ }
1236
+
1237
+ // is page module by plugin
1238
+ if ( this . config . plugins . some ( p => p . type === 'loader' && p . test . test ( url ) && p . allowPage ) ) {
1239
+ return true
1240
+ }
1241
+
1242
+ // is dep
1243
+ for ( const { deps } of this . #modules. values ( ) ) {
1244
+ if ( deps . some ( dep => dep . url === url ) ) {
1245
+ return true
1246
+ }
1247
+ }
1248
+
1249
+ return false
1250
+ }
1251
+
1252
1252
/** lookup deps recurively. */
1253
1253
private lookupDeps ( url : string , __deps : DependencyDescriptor [ ] = [ ] , __tracing : Set < string > = new Set ( ) ) {
1254
1254
const mod = this . getModule ( url )
0 commit comments