kt3k / packup

📦 Zero-config web application packager for Deno
https://packup.deno.dev/
MIT License
328 stars 18 forks source link

Full URLs treated as paths #21

Closed rotu closed 3 years ago

rotu commented 3 years ago

When packing the following file, packup incorrectly treats the script src as a relative path instead of a fully qualified url:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script src="http://unpkg.com/vue@next"></script>
</head>
<body>

</body>
</html>
packup build test.html
Writing the assets to dist
No static dir "static"
 > error: [plugin: deno] Cannot resolve module "file:///Users/dan/Documents/http:/unpkg.com/vue@next".

error: Uncaught (in promise) Error: Build failed with 1 error:
error: Cannot resolve module "file:///Users/dan/Documents/http:/unpkg.com/vue@next".
  let error = new Error(`${text}${summary}`);
              ^
    at failureErrorWithLog (https://deno.land/x/esbuild_loader@v0.12.8/vendor/browser.js:1428:15)
    at https://deno.land/x/esbuild_loader@v0.12.8/vendor/browser.js:1110:28
    at runOnEndCallbacks (https://deno.land/x/esbuild_loader@v0.12.8/vendor/browser.js:900:63)
    at buildResponseToResult (https://deno.land/x/esbuild_loader@v0.12.8/vendor/browser.js:1108:7)
    at https://deno.land/x/esbuild_loader@v0.12.8/vendor/browser.js:1215:14
    at https://deno.land/x/esbuild_loader@v0.12.8/vendor/browser.js:588:9
    at handleIncomingPacket (https://deno.land/x/esbuild_loader@v0.12.8/vendor/browser.js:685:9)
    at readFromStdout (https://deno.land/x/esbuild_loader@v0.12.8/vendor/browser.js:555:7)
    at Object.worker.onmessage (https://deno.land/x/esbuild_loader@v0.12.8/vendor/browser.js:2276:36)
    at https://deno.land/x/esbuild_loader@v0.12.8/vendor/browser.js:2267:41
kt3k commented 3 years ago

Thank you for reporting this!

When packing the following file, packup incorrectly treats the script src as a relative path instead of a fully qualified url:

Right, http(s)://... should be handled as external url reference. We addressed that in #22, and released the fix as v0.1.3. Please update the cli.

rotu commented 3 years ago

Thank you! Can verify this is fixed.