Repository navigation
Keep Create React App npm scripts working after the Vite migration - #23
Merged
Merged
Conversation
npm start runs the Vite dev server on port 3000 and opens a browser, as under CRA. npm test and npm run eject explain why they no longer apply instead of failing with "Missing script". Document the frontend dev workflow and fix the invalid "npm build" instruction in the README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #22. That PR replaced Create React App with Vite but dropped CRA's npm scripts, so anyone used to working on
welcome/webappthe CRA way would hit errors. This PR restores the familiar commands.npm startMissing script: "start"npm run buildbuild/npm testMissing script: "test"npm run ejectMissing script: "eject"vite.config.jsnpm run dev/npm run previewvite.config.js: addedserver: { port: 3000, open: true }to match CRA's dev-server defaults (Vite defaults to port 5173 and doesn't open a browser).BROWSER=nonestill turns off opening the browser. This only affects the dev server; the production bundle is byte-identical (build/assets/index-CX8gFJVw.jsunchanged).README.md:npm install && npm run build);npm buildisn't a valid npm command.Neither CRA nor Vite has ever proxied the
/welcome/*API calls to the XTC backend, so the dev server shows the page without data. That hasn't changed.Verification:
BROWSER=none npm start: serves/and/src/App.jsxwith 200 on port 3000.npm testprints its message and exits 1;npm run ejectprints its message and exits 0.npm run buildand./gradlew :welcome:buildsucceed.