* docs: migrate ui docs to docs universe * created yarn workspace * added eslint and tsconfig configurations * fix eslint configurations * fixed eslint configurations * shared tailwind configurations * added shared ui package * added more shared components * migrating more components * made details components shared * move InlineCode component * moved InputText * moved Loading component * Moved Modal component * moved Select components * Moved Tooltip component * moved Search components * moved ColorMode provider * Moved Notification components and providers * used icons package * use UI colors in api-reference * moved Navbar component * used Navbar and Search in UI docs * added Feedback to UI docs * general enhancements * fix color mode * added copy colors file from ui-preset * added features and enhancements to UI docs * move Sidebar component and provider * general fixes and preparations for deployment * update docusaurus version * adjusted versions * fix output directory * remove rootDirectory property * fix yarn.lock * moved code component * added vale for all docs MD and MDX * fix tests * fix vale error * fix deployment errors * change ignore commands * add output directory * fix docs test * general fixes * content fixes * fix announcement script * added changeset * fix vale checks * added nofilter option * fix vale error
2.7 KiB
description, sidebar_label, slug, sidebar_custom_props
| description | sidebar_label | slug | sidebar_custom_props | ||
|---|---|---|---|---|---|
| Actions Required for Vite Update | (Repository) Vite | /upgrade-guides/admin/admin-vite |
|
Updating Medusa Admin from Gatsby to Vite
Medusa Admin has been updated to Vite. Learn about breaking changes since the update.
:::warning
This guide applies if you're using an old version of the admin repository and you're adding the latest changes of the repository. However, this repository is now deprecated and it's highly recommended to switch to using an admin plugin instead. You can learn more in the upgrade guide
:::
Overview
Medusa Admin previously was built using Gatsby. As of a recent update, the Admin is now migrated to Vite 3.
This introduced breaking changes related to environment variables used and the published directory. Read below for actions required following this update.
Required Node.js Version
Following the change to Vite 3, the required Node.js version for the Admin has changed. Vite 3 requires versions 14.8+ or 16+ of Node.js.
Changed Environment Variables
Previously, the Medusa Admin used the environment variables GATSBY_MEDUSA_BACKEND_URL or GATSBY_STORE_URL to store the Medusa backend’s URL.
After the update to Vite, the environment variable name changed to MEDUSA_BACKEND_URL.
The Medusa admin remains backward compatible, which means you can still use the same environment variables. However, it is advised to make the change to the new variable.
Actions Required
Change your GATSBY_MEDUSA_BACKEND_URL or GATSBY_STORE_URL environment variables to be MEDUSA_BACKEND_URL:
MEDUSA_BACKEND_URL=<YOUR_BACKEND_URL>
Changed Publish Directory
Previously, the build output of the Medusa Admin was placed in the dist directory. After this update, the build output is placed in the public directory.
For local usage and development, this shouldn’t have an effect. However, this is a breaking change if you deployed Medusa admin.
Actions Required
If you deployed your Medusa admin, you must change the Publish directory in your hosting.
For Netlify, you can do that by following these steps:
- On your Medusa admin dashboard, click on “Site settings”.
- From the sidebar, choose “Build & deploy”.
- Find the “Build settings” section and click on the “Edit settings” button.
- Change the “Publish directory” field to
public. - Click on the Save button.
This should trigger a new deployment of your Medusa admin. If not, you must redeploy it manually for changes to take effect.