File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -566,7 +566,15 @@ impl DenoLoader {
566566 Cow :: Borrowed ( & transpile_and_emit_options. transpile )
567567 } ;
568568 let emit_options = EmitOptions {
569- source_map_base : Some ( self . workspace_factory . workspace_directory ( ) ?. workspace . root_dir ( ) . as_ref ( ) . clone ( ) ) ,
569+ source_map_base : Some (
570+ self
571+ . workspace_factory
572+ . workspace_directory ( ) ?
573+ . workspace
574+ . root_dir ( )
575+ . as_ref ( )
576+ . clone ( ) ,
577+ ) ,
570578 ..transpile_and_emit_options. emit . clone ( )
571579 } ;
572580 let transpiled_source = parsed_source
@@ -632,6 +640,7 @@ fn parse_entrypoint(
632640) -> Result < Url , anyhow:: Error > {
633641 if entrypoint. starts_with ( "jsr:" )
634642 || entrypoint. starts_with ( "https:" )
643+ || entrypoint. starts_with ( "http:" )
635644 || entrypoint. starts_with ( "file:" )
636645 || entrypoint. starts_with ( "npm:" )
637646 {
Original file line number Diff line number Diff line change 1+ import { assertResponseText , createLoader } from "./helpers.ts" ;
2+
3+ Deno . test ( "loads from http server" , async ( ) => {
4+ await using server = Deno . serve ( ( _request ) => {
5+ return new Response ( "console.log(1);" , {
6+ headers : {
7+ "content-type" : "application/javascript" ,
8+ } ,
9+ } ) ;
10+ } ) ;
11+
12+ const url = `http://localhost:${ server . addr . port } /no-extension` ;
13+ const { loader } = await createLoader ( { } , {
14+ entrypoints : [ url ] ,
15+ } ) ;
16+
17+ const response = await loader . load ( url ) ;
18+ assertResponseText (
19+ response ,
20+ `console.log(1);` ,
21+ ) ;
22+ } ) ;
You can’t perform that action at this time.
0 commit comments