lasso-js / lasso

Advanced JavaScript module bundler, asset pipeline and optimizer
581 stars 75 forks source link

Improve image includes or document alternatives #208

Open zephraph opened 7 years ago

zephraph commented 7 years ago

Sorry about the title, I may need to reword it.

Currently the only way to include images (that I'm aware of) is by either using lasso-image or using the lasso-img tag. I would love to be able to do something like

import myImage from './images/img.png';

div style="background-image: url(${input.backgroundImage})"

Essentially its a static image in the src somewhere that I just want to be able to get the URL for at build time. Is this something that can be done currently via a mechanism I'm unfamiliar with? Are there other alternatives?

patrick-steele-idem commented 7 years ago

/cc @austinkelleher @mlrawlings

DylanPiercey commented 7 years ago

@zephraph essentially looking for file-loader for lasso?

zephraph commented 7 years ago

Basically, yeah.