8000 Using import in webc:setup · Issue #225 · 11ty/webc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Using import in webc:setup #225
Open
@harrislapiroff

Description

@harrislapiroff

Is there any way to import a node-installed library into a webc:setup script?

Trying this in a webc file fails silently:

<script webc:setup>
  import Fetch from '@11ty/eleventy-fetch' 
</script>

These also do not work:

<script webc:setup>
  const Fetch = await import('@11ty/eleventy-fetch')
</script>
<script webc:setup>
  const Fetch = require('@11ty/eleventy-fetch')
</script>

Even if this isn't possible or desirable, silent failure—aborting compilation altogether—also seems like an issue here (though it's not clear to me if that issue is here or in eleventy-plugin-webc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0