@webhandle/external-resource-manager 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,9 @@ export default function createApplicationJavascriptRenderer(webhandle) {
9
9
  if (resource.url.startsWith('data:')) {
10
10
  // We don't want to prefix a data url
11
11
  }
12
+ else if (resource.url.startsWith('http')) {
13
+ // We don't want to prefix an absolute url
14
+ }
12
15
  else {
13
16
  vrsc = '/vrsc/' + webhandle.resourceVersion
14
17
  }
@@ -8,6 +8,9 @@ export default function createTextCssRenderer(webhandle) {
8
8
  if (resource.url.startsWith('data:')) {
9
9
  // We don't want to prefix a data url
10
10
  }
11
+ else if (resource.url.startsWith('http')) {
12
+ // We don't want to prefix an absolute url
13
+ }
11
14
  else {
12
15
  vrsc = '/vrsc/' + webhandle.resourceVersion
13
16
  }
@@ -17,7 +17,14 @@ export default function createImportmapGenerator(webhandle) {
17
17
 
18
18
  found = true
19
19
  if(resource.data && !resource.url) {
20
- let content = `export default ${JSON.stringify(resource.data)}`
20
+ let d = JSON.stringify(resource.data)
21
+ // # in the value trigger a problem in the browser where it doesn't think #
22
+ // are valid for the types of URLs it's looking for. That's a little weird
23
+ // given that this is a data url. It's possible these values should be
24
+ // fully URI encoded, but other values which would normally need that
25
+ // don't seem to cause problems.
26
+ d = d.split('#').join('%23')
27
+ let content = `export default ${d}`
21
28
  let url = `data:text/javascript,${content}`
22
29
  resource.url = url
23
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webhandle/external-resource-manager",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "external-resource-manager.js",
6
6
  "scripts": {