Commit 8de9ae9
fix: Fix first time download (#10)
* Fix first time download
Hi,
With Rollup.js i wasn't able to « import "https://…" » i notice « Url is undefined » (line https://github.com/egoist/import-http/blob/master/lib/rollup.js#L57) when the targeted library isn't in the cache.
Since the URL is also the key its solve the problem.
OS: MacOS
NodeJS Version : 11.13.0
Bundler : RollupJS
Original log :
```sh
$ rollup -c
src/main.js → dist/bundle.js...
Downloading undefined...
[!] Error: Could not load https://cdn.jsdelivr.net/npm/vue/dist/vue.esm.browser.js (imported by /Users/valentinbrosseau/dev/vue-yasb/src/main.js): Only absolute URLs are supported
Error: Could not load https://cdn.jsdelivr.net/npm/vue/dist/vue.esm.browser.js (imported by /Users/valentinbrosseau/dev/vue-yasb/src/main.js): Only absolute URLs are supported
at /usr/local/lib/node_modules/rollup/dist/rollup.js:17855:19
at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:52:5)
at Function.Module.runMain (internal/modules/cjs/loader.js:871:11)
at internal/main/run_main_module.js:21:11
```
* Update http-cache.js
* Use ID instead of url
Since URL is undefined the first time (file not present in cache).1 parent 42ce89f commit 8de9ae9
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
0 commit comments