bridgetownrb / bridgetown

A next-generation progressive site generator & fullstack framework, powered by Ruby
https://www.bridgetownrb.com
MIT License
1.14k stars 114 forks source link

feat: support multiple webpack js entry points #246

Closed rubys closed 3 years ago

rubys commented 3 years ago

Summary

webpack_path supports only a single js and css file. The request is to support multiple webpack entry points for js.

Motivation

The ruby2js.com site has multiple js files, one of which is quite large (the opal generated one). It would be best if the interactivity of the site didn't depend on everything having been loaded before anything can begin.

Reference-level explanation

Perhaps webpack_path could accept an optional second parameter?

Drawbacks

None? It should not affect those that do not use this feature.

Unresolved Questions

I' m not sure how best to handle someone defining multiple entry points in their webpack config but omitting the second parameter on the webpack_path. I haven't explored what the current behavior is in that case.

jaredcwhite commented 3 years ago

Take a look at the updated webpack.config.js starter in PR #247 — that plus enhancements to webpack_path should now support multiple entry points, as well as other files in the manifest (fonts, images…)

jaredcwhite commented 3 years ago

Rolling out with v0.20 release.