DEV Community

Discussion on: Serving Single-Page Application in a single binary file with Go

Collapse
 
abiiranathan profile image
Dr. Abiira Nathan

Nice article over here. Do you have an idea on to make go://embed include lazy loaded sveltekit endpoints that start with . e.g _id.indexeadfg.js?

If my SPA has hundreds of these, I cant include them one by one.

Collapse
 
aryaprakasa profile image
Arya Prakasa

Hi thanks,

You can do something like these:

//go:embed build/*
//go:embed build/*/*/*/*
//go:embed build/*/*/*/*/*
Enter fullscreen mode Exit fullscreen mode

Or explicitly embed specific file type:

//go:embed build/*.js
//go:embed build/*/*/*/*.js
//go:embed build/*/*/*/*/*.js
Enter fullscreen mode Exit fullscreen mode
Collapse
 
abiiranathan profile image
Dr. Abiira Nathan

That was actually helpful.