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

fix(getNodeProcess): check if process is available #795

Merged
merged 1 commit into from
Mar 3, 2023

Conversation

danilowoz
Copy link
Member

@vercel
Copy link

vercel bot commented Mar 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
sandpack-docs ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 3, 2023 at 9:41AM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 3, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e18f77c:

Sandbox Source
Sandpack Configuration
strange-bardeen-brj7y5 Configuration

@Jokcy
Copy link
Contributor

Jokcy commented Mar 4, 2023

@danilowoz This breaks the SANDPACK_BARE_COMPONENTS ability for disabling default css solution. We need to figure out a better way for this feature, it's not a good idea to depend on process.env for client packages, different bundler treat this in default way.

For example vite recommend we use import.mate.env which is supported out box, but if we want to use process.env we need additional configuration. So process.env is not a common standard for client packages.

I guess it's better we directly build two version dist files and make SANDPACK_BARE_COMPONENTS take effect at build time. The default build will include the default styles and a new build maybe called styleless/index.js exculde it.

In this way we can complete exclude stitches related code in the styleless build, in the current solution, although we can disable the default style but the code still being bundled into the application which is a waste. And because of the typeof process condition tree shaking will take effect to reduce the useless code.

@Jokcy Jokcy mentioned this pull request Mar 4, 2023
4 tasks
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.

2 participants