Skip to content

Migrate CRA to Vite - #179

Open
hobbsythe6th wants to merge 25 commits into
Candlestickers:developmentfrom
hobbsythe6th:vite-migrate
Open

hobbsythe6th wants to merge 25 commits into
Candlestickers:developmentfrom
hobbsythe6th:vite-migrate

Conversation

@hobbsythe6th

@hobbsythe6th hobbsythe6th commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Migrated CRA to Vite and removed a lot of scss deprecation warnings that Vite likes throwing. Also, for some reason our jsx has require('classnames') in basically every file, which I fixed. AND, since the jsconfig.json data is now in vite.config.js, the jsconfig has been deleted with no ill effects!

@InternetAstronaut

Copy link
Copy Markdown
Contributor

Vite migration is something we really need, the extra 5 seconds may look stale until you notice this means we can stop doing things like almost patching packages that CRA requires.

@hobbsythe6th
hobbsythe6th marked this pull request as draft August 18, 2026 08:03
@hobbsythe6th
hobbsythe6th marked this pull request as ready for review August 19, 2026 11:44
@StickmanRed

Copy link
Copy Markdown
Collaborator

I think we should split this into two PRs: one with just the @import to @use and require() to import changes, and then one with the CRA to Vite changes. This would make it easier to review and focus on the Vite changes

@hobbsythe6th

Copy link
Copy Markdown
Contributor Author

I know, but I'm not experienced enough with Git to move a singular commit to another branch/delete singular commit. Also, even though CRA throws the scss stuff, I didn't find it till the Vite tests so it ended up in the Vite mess. Vite's much stricter about ESM/CJS so the require() thing was also a new mid-PR discovery. I'll try and put it in another PR tho

@StickmanRed

Copy link
Copy Markdown
Collaborator

Sounds good! Though let me know if you'd want any help with the process

…names' and not require('classnames')"

This reverts commit a572ec1.
@import because it fills the terminal up with annoying deprecation warnings"

This reverts commit 2f73e6b.
@hobbsythe6th

hobbsythe6th commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

I think I reverted the commits, but it makes this PR untestable sadly. but I can't believe how much easier to read the diff is!

return 'builtinlibrary/'; // resources folder will be flattened
}
return process.env.PUBLIC_URL + '/builtinlibrary/';
return import.meta.env.VITE_PUBLIC_URL + 'builtinlibrary/';

@StickmanRed StickmanRed Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not too sure how process.env.PUBLIC_URL works and what its value is in production builds... this is just a reminder for myself to double-check these parts and make sure they will work in the candlestick page

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

as far as I know process.env is an object CRA injected into the build that just has everything in the .env file. import.meta.env is Vite's version of that

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.

3 participants