-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
css outputs missing entryPoint in metafile #1861
Comments
As far as I can tell, with multiple entry points and There's a good chance that I've just missed something considering how few people have interacted with this issue, but I'm struggling with the same problem. I'm bundling multiple entrypoints, then injecting the appropriate script/link tags into their associated html files. From the comment below, it sounds like this was a deliberate decision not to give CSS files an entrypoint property. esbuild/internal/bundler/linker.go Lines 5371 to 5379 in 7208846
My current workaround is to ensure that each entry point has a (generated) unique ID that is included in the output file name. entryPoints = append(entryPoints, api.EntryPoint{
InputPath: fmt.Sprintf("page:%s", page.id),
OutputPath: page.id,
}) Then I piece those entrypoints back together using those IDs when I need to inject scripts. for _, file := range result.OutputFiles {
if strings.Contains(file.Path, page.id) {
switch path.Ext(file.Path) {
case ".js":
scripts = append(scripts, file.Path)
case ".css":
styles = append(styles, file.Path)
}
}
} @evanw Is there a better solution here and if not, would you accept a PR that added a |
It seems the css output missing entryPoint info , which is inconvenient to group css file according to entryPoint, which is important for html-plugin supporting multi page application.
The text was updated successfully, but these errors were encountered: