jekyll-importmap 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-importmap/resolver.rb +21 -3
- data/lib/jekyll-importmap/version.rb +1 -1
- data/lib/jekyll-importmap.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ead9e5ef88119687765f61cdfd463ee731c94b78864a29f63220ea3ecc694336
|
4
|
+
data.tar.gz: b0844196067dbb1cd631738fcbdb1d909c118827bafe441fee55dfc74e8412f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebfa452243f27acd9b091051d57b9ef21f670c979e06b5257f2b5384d7bb32901c4efc098341313c708adf0036822495753a2c877cd51a32ffc7cd6e82038c5a
|
7
|
+
data.tar.gz: ef39d2ea8b94d535658dd910c11daef2856e222c5a07aa5babc5a51ee7efa47266f6086015633c6284c2aaa02b2ebe2b0e4b55d6df111c2d61144bcc507f00d0
|
@@ -6,12 +6,30 @@ module Jekyll::Importmap
|
|
6
6
|
'https://' + self.url + JS_PATH + '/' + path
|
7
7
|
end
|
8
8
|
|
9
|
-
def self.
|
10
|
-
if Jekyll.configuration['
|
11
|
-
Jekyll.configuration['
|
9
|
+
def self.host_or_url
|
10
|
+
if Jekyll.configuration['url']
|
11
|
+
Jekyll.configuration['url']
|
12
12
|
else
|
13
13
|
Jekyll.configuration['host']
|
14
14
|
end
|
15
15
|
end
|
16
|
+
def self.base_url
|
17
|
+
if Jekyll.configuration['baseurl']
|
18
|
+
'/' + Jekyll.configuration['baseurl']
|
19
|
+
else
|
20
|
+
''
|
21
|
+
end
|
22
|
+
end
|
23
|
+
def self.port
|
24
|
+
if Jekyll.configuration['port'] && Jekyll.configuration['port'].length > 0
|
25
|
+
':' + Jekyll.configuration['port']
|
26
|
+
else
|
27
|
+
''
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.url
|
32
|
+
self.host_or_url + self.port + self.base_url
|
33
|
+
end
|
16
34
|
end
|
17
35
|
end
|
data/lib/jekyll-importmap.rb
CHANGED
@@ -18,7 +18,7 @@ module Jekyll
|
|
18
18
|
super
|
19
19
|
#root_path = Pathname.new(Jekyll.configuration['source']) + '/'
|
20
20
|
root_path = Dir.pwd + '/'
|
21
|
-
@importmap = Jekyll::Importmap::Map.new.draw(root_path.
|
21
|
+
@importmap = Jekyll::Importmap::Map.new.draw(root_path.concat(IMPORTMAP_PATH))
|
22
22
|
@entry_point = "application"
|
23
23
|
end
|
24
24
|
|
@@ -47,7 +47,7 @@ module Jekyll
|
|
47
47
|
Array(paths).collect {|p| %(<link rel="modulepreload" href="#{p}">)}.join('\n')
|
48
48
|
end
|
49
49
|
def import_module_tag
|
50
|
-
imports = Array(
|
50
|
+
imports = Array(*@entry_point).collect {|e| %(import '#{e}')}.join('\n')
|
51
51
|
"<script type='module'>#{imports}</script>"
|
52
52
|
end
|
53
53
|
def es_module_shim_tag
|