avatar
David Darnes @darn.es

You’ll want to look at the @11ty.dev file passthrough API www.11ty.dev/docs/copy/ This is how I bring my node_module files through to my build. Not the most elegant, but the path of least resistance

aug 31, 2025, 5:43 pm • 2 1

Replies

avatar
Michael G @g12n.de

Thank you. I had a similar thought. Though the lack of elegance had me hoping somebody had already found a smarter solution. bsky.app/profile/g12n...

aug 31, 2025, 5:45 pm • 0 0 • view
avatar
Eleventy v4.0.0-alpha.4 @11ty.dev

bsky.app/profile/11ty... might be an improvement on that (and a nod to yet another improvement there too)

sep 2, 2025, 1:47 pm • 6 0 • view
avatar
David Darnes @darn.es

What would smarter look like?

aug 31, 2025, 5:47 pm • 0 0 • view
avatar
Michael G @g12n.de

Good question. Maybe a collector that rewrites and copies esm imports into a folder (maybe even downloads remote ones) automatically. Similar to how eleventy-image does it. Though that would be again a very build-centric solution. 😬

aug 31, 2025, 5:51 pm • 0 0 • view
avatar
Michael G @g12n.de

Though it wouldn't have to rewrite the codes if it generated the appropriate import map for the projects npm modules. bsky.app/profile/dutc...

aug 31, 2025, 6:19 pm • 0 0 • view
avatar
David Darnes @darn.es

I guess what you could do is create a json file that is your import map, consume it with eleventy to pass through the files and then insert it into a script tag as your import map 🤔

aug 31, 2025, 6:40 pm • 1 0 • view
avatar
Michael G @g12n.de

I will look into it.

aug 31, 2025, 6:56 pm • 1 0 • view
avatar
David Darnes @darn.es

Only drawback to this, at least with my web components, is that there’s nothing to really import. My component scripts are self initiating. I have considered employing @zachleat.com’s approach to allowing both use cases:

sep 1, 2025, 9:11 am • 0 0 • view
avatar
Michael G @g12n.de

Well. We can’t really expect every author to stick to one pattern. So basically a way to collect the JS files and drop them into a folder is what we look for. Damn. How did we do that in jquery times?

sep 1, 2025, 9:26 am • 1 0 • view
avatar
David Darnes @darn.es

It’s nice to provide both routes, dropping the script tag in and away you go or fancy importing

sep 1, 2025, 9:43 am • 0 0 • view