9.0.0: Bye Webpack, hi Vite!
Changes
This is a major rewrite. Sorry. But the good news is migrating the pages, components & layouts from your Tropical <8.0.1 site to 9.0.0 should be straightforward. It's just everything around your content that has changed.
(If you find this isn't true, please open an issue and I'll update the upgrade instructions as necessary.)
- Vite replaces all the stuff we were previously cobbling together with Webpack, Babel, Serve, and quite a bit of custom code. The custom code that does exist (for the dev server & prerendering) is mostly copied straight from Vite's SSR Guide.
- MDX support now comes from vite-plugin-mdx. It still supports the rehype or remark plugins we were using before.
Upgrade instructions
The easiest approach will be to start with a new Tropical 9.0.0 site, then copy across your existing pages, components, layouts and client-side JS. (Of course when this is all done, you can commit it all to your existing git repo.)
See #27 for the commit-by-commit process I took to update this repo.
Here are the main tweaks you'll need to make:
- Your content now lives in
srcrather thanapp - Pages:
- File extensions are now either
.mdxor.jsx..jswon't work for files that contain JSX, and.mdwon't work for MDX files. meta.collectionhas been replaced with themeta.tagsarray. A JSON feed/posts.jsonis generated for pages containing theposttag.
- File extensions are now either
- Layouts:
- Now use react-head instead of react-helmet
- JSON Feed:
- The default feed has changed from
/feed.jsonto/posts.json. Renamesrc/feeds/posts.jsxif you don't want to lost all your subscribers!
- The default feed has changed from
- Client side JS:
client.jsis nowsrc/entry-client.jsx. You can still put whatever you want in here.- If you were using the old
hydrationHelpers, that functionality now lives in a standalone package tropical-islands.- Instead of
asIsland, use<Island>. It accomplishes the same thing, but you don't need to export extra components now.
- Instead of
- Production static site build:
- The new output directory is
dist/static
- The new output directory is