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

bug/issue 1223 handle incorrect nested SSR page bundle output name mapping #1224

Closed thescientist13 closed 2 months ago

thescientist13 commented 2 months ago

Related Issue

resolves #1223

Summary of Changes

  1. Map SSR page output paths and bundle names to Rollup bundle names
  2. Added relativeWorkspacePagePath as convenience to the graph for each page, should track as part of #1167
  3. Incorporated this change to handle a change in behavior in latest Node 18.20.x

Will make to align with work being done in https://github.com/ProjectEvergreen/greenwood/pull/1212

TODO

  1. [x] fix windows build failures
  2. [x] Phantom _.greenwood/__ directory?
  3. [x] Downstream testing
  4. [x] Create an enhancement issue for making sure we have better control over output map naming - https://github.com/ProjectEvergreen/greenwood/issues/1226

Main issue was with very loose enforcement of output naming, such that when running this sort of pages through Rollup

src/
  pages/
    blog/
      index.js
    index.js

Both of those will come out of the same name to Rollup, and because they will be duplicates, you'll be getting unexpected names, like

So the main fix here is to map our bundle names to whatever Rollup spits out for now just keep things working and in sync.