File tree Expand file tree Collapse file tree 7 files changed +28
-5
lines changed Expand file tree Collapse file tree 7 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -365,6 +365,7 @@ impl WorkerPool {
365
365
maybe_jsx_import_source_config,
366
366
maybe_s3_fs_config,
367
367
maybe_tmp_fs_config,
368
+ static_patterns,
368
369
..
369
370
} = worker_options;
370
371
@@ -381,7 +382,7 @@ impl WorkerPool {
381
382
maybe_module_code,
382
383
maybe_entrypoint,
383
384
maybe_decorator,
384
- static_patterns : vec ! [ ] ,
385
+ static_patterns,
385
386
386
387
maybe_jsx_import_source_config,
387
388
maybe_s3_fs_config,
@@ -714,7 +715,7 @@ pub async fn create_user_worker_pool(
714
715
None => break ,
715
716
Some ( UserWorkerMsgs :: Create ( worker_options, tx) ) => {
716
717
worker_pool. create_user_worker( WorkerContextInitOpts {
717
- static_patterns: static_patterns. clone( ) ,
718
+ static_patterns: [ worker_options . static_patterns, static_patterns . clone( ) ] . concat ( ) ,
718
719
maybe_jsx_import_source_config: {
719
720
if worker_options. maybe_jsx_import_source_config. is_some( ) {
720
721
worker_options. maybe_jsx_import_source_config
Original file line number Diff line number Diff line change 4
4
" ./crates/base/test_cases"
5
5
],
6
6
"fmt" : {
7
- "useTabs" : true ,
7
+ "useTabs" : false ,
8
8
"lineWidth" : 100 ,
9
9
"indentWidth" : 4 ,
10
10
"singleQuote" : true ,
14
14
"npm:@meowmeow/foobar" : " npm:is-odd" ,
15
15
"openai" : " npm:openai"
16
16
}
17
- }
17
+ }
Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ Deno.serve(async (req: Request) => {
131
131
//
132
132
const cpuTimeSoftLimitMs = 10000 ;
133
133
const cpuTimeHardLimitMs = 20000 ;
134
+ const staticPatterns = [
135
+ './examples/**/*.html' ,
136
+ ] ;
134
137
135
138
return await EdgeRuntime . userWorkers . create ( {
136
139
servicePath,
@@ -143,6 +146,7 @@ Deno.serve(async (req: Request) => {
143
146
netAccessDisabled,
144
147
cpuTimeSoftLimitMs,
145
148
cpuTimeHardLimitMs,
149
+ staticPatterns,
146
150
// maybeEszip,
147
151
// maybeEntrypoint,
148
152
// maybeModuleCode,
Original file line number Diff line number Diff line change
1
+ < html >
2
+ < h1 > Bar</ h1 >
3
+ </ html >
Original file line number Diff line number Diff line change
1
+ < html >
2
+ < h1 > Foo</ h1 >
3
+ </ html >
Original file line number Diff line number Diff line change
1
+ import { join } from 'https://deno.land/std/path/mod.ts' ;
2
+
3
+ Deno . serve ( async ( req ) => {
4
+ if ( req . url . endsWith ( '/foo' ) ) {
5
+ return new Response ( await Deno . readTextFile ( join ( import . meta. dirname , 'foo.html' ) ) ) ;
6
+ } else {
7
+ return new Response ( await Deno . readTextFile ( join ( import . meta. dirname , 'bar.html' ) ) ) ;
8
+ }
9
+ } ) ;
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ pub struct UserWorkerCreateOptions {
91
91
tmp_fs_config : Option < TmpFsConfig > ,
92
92
93
93
context : Option < JsonMap > ,
94
+ #[ serde( default ) ]
95
+ static_patterns : Vec < String > ,
94
96
}
95
97
96
98
#[ op2( async ) ]
@@ -131,6 +133,7 @@ pub async fn op_user_worker_create(
131
133
tmp_fs_config : maybe_tmp_fs_config,
132
134
133
135
context,
136
+ static_patterns,
134
137
} = opts;
135
138
136
139
let user_worker_options = WorkerContextInitOpts {
@@ -165,7 +168,7 @@ pub async fn op_user_worker_create(
165
168
}
166
169
} ) ,
167
170
168
- static_patterns : vec ! [ ] ,
171
+ static_patterns,
169
172
import_map_path,
170
173
timing : None ,
171
174
You can’t perform that action at this time.
0 commit comments