ProjectEvergreen / greenwood

Greenwood is your full-stack workbench for the web, focused on supporting modern web standards and development to help you create your next project.
https://www.greenwoodjs.io
MIT License
94 stars 9 forks source link

improve naming for (nested) bundled SSR page and API route entry points to better reflect original file based routing name #1226

Closed thescientist13 closed 1 week ago

thescientist13 commented 2 months ago

Summary

Coming out of #1223 / #1224 was the realization that nested SSR page bundles, in particular those with the name route based file name, e.g.

src/
  pages/
    blog/
      index.js

Will get the following top level bundle names from Rollup due to the repeated index.js files in this case

public/
  _index.js
  _index2.js
  _index3.js
  ...

Details

While in the PR this was fixed by leveraging the bundle names created by Rollup and updating outputPath on the route object in the graph, it would be better if the naming was more reflective of the source route name path, e.g.

public/
  _index.js
  _blog-index.js

Or output based on path

public/
  blog/
    _index.js
  _index.js

Notes:

thescientist13 commented 1 month ago

This was kind of done in #1236