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

build(playground): migrate from Create React App to Vite #4570

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

glowcloud
Copy link
Contributor

@glowcloud glowcloud commented Nov 29, 2024

Refs #4384

For the removed files in scripts, it seems that the polyfills for fs and path which were disabled by this config:

  config.resolve.fallback = {
    ...config.resolve.fallback,
    fs: false,
    path: false,
  };

should be automatically disabled by Vite. When building the project, I get this warning:

[plugin vite:resolve] Module "fs" has been externalized for browser compatibility

which should mean that the polyfills are disabled: https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility

@glowcloud glowcloud added enhancement New feature or request dependencies labels Nov 29, 2024
@glowcloud glowcloud self-assigned this Nov 29, 2024
export default defineConfig({
plugins: [
react(),
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This plugin is a replacement for this part of the previous start script:

cross-env GENERATE_SOURCEMAP=false

Using other sourcemap configs did not disable them for JS files.

Source: vitejs/vite#9825 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant