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

Replace Webpack with Vite #27

Merged
merged 24 commits into from
Jul 17, 2021
Merged

Replace Webpack with Vite #27

merged 24 commits into from
Jul 17, 2021

Conversation

bensmithett
Copy link
Owner

@bensmithett bensmithett commented Jul 17, 2021

This is a big rewrite using Vite. It's way better.

browserslist has sensible default values now
* lots of the Webpack stuff in build.js will be handled by Vite
* hydrationHelpers have been slightly rewritten and released as a standalone lib, tropical-islands
Vite will handle those responsibilities for us!
It'll be easier to init from scratch
Don't need this config any more
`yarn create @vitejs/app` will give us a new set of dependencies from scratch
The Vite React app scaffold
I don't care for the dependencies/devDependencies split. You need all dependencies
to be able to do anything in Tropical.
This boilerplate is for a client-side React app. Tropical is all about the SSR!
We'll keep using both CodeBlock and cssReset with some minor changes
* Ran `npx sb@next init --builder storybook-builder-vite` as per https://storybook.js.org/blog/storybook-for-vite/
* Changed component & story file extensions from `js` to `jsx` (Vite uses this to transpile JSX)
* `yarn install`
* Followed Vite's guides and examples for setting up a dev server and prerender (static site build) https://vitejs.dev/guide/ssr.html and https://github.com/vitejs/vite/blob/main/packages/playground/ssr-react/prerender.js
* Added MDX support via vite-plugin-mdx
* Add some helpers for working with tags
* Add example pages
* Add a JSON Feed
* Make all of that render both from the dev server and the static build
* Get island hydration working with the new tropical-islands package (replaces this repo's old hydrationHelpers)
* Add scripts for scaffolding new pages & components (via tropical-scaffold package)
@bensmithett bensmithett merged commit e983e9d into main Jul 17, 2021
@bensmithett bensmithett deleted the bye-webpack-hi-vite branch July 17, 2021 07:30
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.

1 participant