Skip to content
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

refactor: Switch to vite-prerender-plugin #153

Merged
merged 4 commits into from
Jan 10, 2025

Conversation

rschristian
Copy link
Member

Moved it into the Preact org just the other day (preactjs/vite-prerender-plugin) as I wanted to keep an agnostic package for users to install, but syncing back & forth with this repo was a bit rough. It also is complex enough to warrant a bigger test suite, something which probably shouldn't be added here.

So, this PR switches over to consume it, rather than have an internal copy. Should be easier to maintain in the future hopefully.

@rschristian rschristian force-pushed the refactor/switch-to-vite-prerender-plugin branch from 2f7a44b to 3e0bc9a Compare January 5, 2025 04:11
@rschristian rschristian marked this pull request as ready for review January 8, 2025 08:51
package.json Outdated
@@ -17,7 +17,7 @@
"dev:build": "vite build demo",
"dev:preview": "vite preview demo",
"build": "rimraf dist && tsc && tsc -p tsconfig.cjs.json && node tools/postbuild.mjs",
"test": "node --test test",
"test": "rimraf demo/node_modules && node --test",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We create a temp dir in node_modules (node_modules/<@preact/preset-vite|vite-prerender-plugin>/headless-prerender/...) to allow users to use external, non-bundled node_modules whilst prerendering, but that screws with module resolution a tad. The demo will try to pull from that, but given it's just a holding place rather than an actual, installed module, that won't work.

Side effect of being monorepo-ish here.

Comment on lines -21 to -22

// Head API
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this can be tested upstream

@rschristian rschristian merged commit 66b9069 into main Jan 10, 2025
1 check passed
@marvinhagemeister marvinhagemeister mentioned this pull request Jan 19, 2025
@rschristian rschristian deleted the refactor/switch-to-vite-prerender-plugin branch January 20, 2025 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants