Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import ECMAScript module with an URL #166

Open
joas8211 opened this issue Nov 12, 2021 · 0 comments
Open

Import ECMAScript module with an URL #166

joas8211 opened this issue Nov 12, 2021 · 0 comments

Comments

@joas8211
Copy link
Contributor

Web ecosystem is moving towards decentralized dependency hosting (from centralized, eg. NPM) that can be accomplished currently by importing ECMAScript module with an URL. It seems that it isn't possible though.

The steps to reproduce is as follows.

  1. Create bare Plenti site.
$ plenti new site plenti-url-import --bare
$ cd plenti-url-import
  1. Edit layouts/content/index.svelte as follows:
<script>
    import d3 from 'https://cdn.skypack.dev/d3@7';
</script>
  1. Try to build and serve the site.
$ plenti serve

The error that appears in terminal is similar as in #165:

open public/spa/web_modules/https://cdn.skypack.dev/d3@7: no such file or directoryno such file or directory (File: /home/runner/work/plenti/plenti/cmd/build.go, Line: 145)

It appears that Plenti is trying to look for the module in web_modules althoug it's clearly an external resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant