ProjectEvergreen / greenwood

Greenwood is your workbench for the web, embracing web standards from the ground up to empower your stack from front to back.
https://www.greenwoodjs.io
MIT License
97 stars 9 forks source link

enhancement/issue 923 real production import attributes #1259

Closed thescientist13 closed 2 months ago

thescientist13 commented 2 months ago

Related Issue

923 / #1216

See a prototype here - https://github.com/ProjectEvergreen/www.greenwoodjs.dev/pull/74

Summary of Changes

  1. Support "real" import attributes for production browser bundles
  2. Add documentation

This is mainly a breaking change to plugins.

TODOs

  1. [x] get all test cases back to passing for SSR bundles
  2. [x] website not bundling correctly on ?type=raw resources in a production build
    ![Screenshot 2024-07-20 at 9 38 58 AM](https://github.com/user-attachments/assets/cb425532-7ce7-4dfa-88bc-69ba0a4656a4)
  3. [x] smoke this and #1258 with downstreams
  4. [x] update tests for new behavior for browser bundles
    • import instead of "raw" CSS
    • test for output file bundles now (no more in lining / import ref mapping)
  5. [x] need to handle inline optimization bundle mapping edge case (see https://github.com/AnalogStudiosRI/www.analogstudios.net/pull/98)
  6. [x] should rename this to something like getRollupConfigForBrowser
  7. [x] clean up console logging / commented out code / add clarifying comments to rollup.config.js
  8. [x] documentation updates with an example of Constructable Stylesheets in styles and assets section
  9. [x] update https://github.com/ProjectEvergreen/greenwood/discussions/1216#discussioncomment-10035297 with the latest state of this implementation - https://github.com/ProjectEvergreen/greenwood/discussions/1216#discussioncomment-10137489
  10. [x] handle basePath
  11. [ ] how to exclude module.css? (nice to have)