File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 3
3
require_relative 'host/function_registry'
4
4
require_relative 'host/importer_registry'
5
5
require_relative 'host/logger_registry'
6
+ require_relative 'host/no_op_importer'
6
7
require_relative 'host/value_protofier'
7
8
8
9
module Sass
@@ -54,7 +55,13 @@ def compile_request(path:,
54
55
source : source ,
55
56
url : url &.to_s ,
56
57
syntax : Protofier . to_proto_syntax ( syntax ) ,
57
- importer : importer . nil? ? nil : @importer_registry . register ( importer )
58
+ importer : if url && importer . nil?
59
+ EmbeddedProtocol ::InboundMessage ::CompileRequest ::Importer . new (
60
+ path : File . absolute_path ( '.' )
61
+ )
62
+ else
63
+ @importer_registry . register ( importer . nil? ? NoOpImporter : importer )
64
+ end
58
65
)
59
66
end ,
60
67
path : path . nil? ? nil : File . absolute_path ( path ) ,
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ module Sass
4
+ class Embedded
5
+ class Host
6
+ # An importer that never imports any stylesheets.
7
+ module NoOpImporter
8
+ module_function
9
+
10
+ def canonicalize ( *) ; end
11
+ def load ( *) ; end
12
+ end
13
+
14
+ private_constant :NoOpImporter
15
+ end
16
+ end
17
+ end
You can’t perform that action at this time.
0 commit comments