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

have a plugin for being able to import an image using ESM #517

Closed
1 of 5 tasks
thescientist13 opened this issue Apr 10, 2021 · 2 comments
Closed
1 of 5 tasks

have a plugin for being able to import an image using ESM #517

thescientist13 opened this issue Apr 10, 2021 · 2 comments
Labels
feature New feature or request Plugins Greenwood Plugins

Comments

@thescientist13
Copy link
Member

thescientist13 commented Apr 10, 2021

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

As in #516 , being able to use import for images could have some pretty nice DX, e.g.

import logo from '/assets/logo.png';

...

render() {
  return html`<img src="${logo}" alt="logo image"/>
}

Details

Inspired by webpack file-loader, this plugin could support / provide metadata too, like:

  • if less then 10KB (for example) return data:// URI
  • be able to provide dimensions so that you can set width / height in HTML
  • filename hashing
  • other cool stuff

I wonder if import.meta.url comes into play here?

@thescientist13 thescientist13 added the Plugins Greenwood Plugins label Apr 10, 2021
@thescientist13 thescientist13 added this to the 1.0 milestone Apr 10, 2021
@thescientist13 thescientist13 changed the title have a plugin for being able to import and image using ESM have a plugin for being able to import an image using ESM Apr 10, 2021
@thescientist13 thescientist13 modified the milestones: 1.0, Post 1.0 Nov 11, 2021
@thescientist13 thescientist13 removed this from the Post 1.0 milestone Mar 15, 2022
@thescientist13 thescientist13 added the feature New feature or request label Mar 15, 2022
@thescientist13
Copy link
Member Author

I think let's review this as part of #1163

@thescientist13
Copy link
Member Author

This is / can be better solved through #1163 and will be supported in v0.29.0.

@thescientist13 thescientist13 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request Plugins Greenwood Plugins
Projects
None yet
Development

No branches or pull requests

1 participant