-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Don't redefine process
variable
#6991
Conversation
This pull request is automatically deployed with Now. Latest deployment for this branch: https://monorepo-git-dont-redefine-process.storybook.now.sh |
There is another (recently merged?) PR that was fixing this: #6946? This solution seems better to me however |
It only adds |
🤷♂ |
I was just blindly copy-pasting a fix from another PR. As long as this doesn't break things, I agree this is much cleaner. Any good way to test this? |
Open https://monorepo-git-dont-redefine-process.storybook.now.sh/examples/official-storybook/?path=/graphql/addons-graphql--get-pickachu and see that it works |
Ok, I'm not sure exactly what that proves, but I'll take your word for it 😘 That proves that browser is set to true? |
@shilman No, this proves that defining the whole |
The compiled code for
And |
@cloud-walker yeah, that's exactly the issue this PR fixes |
Don't redefine `process` variable
Issue: by default, webpack injects
process/browser
import wheneverprocess
global variable is used. OurDefinePlugin
overrides it which breaks packages that use stuff likeprocess.cwd()
. One example isunified
package used byreact-markdown
internally.Honestly, I don't remember why I had to add this line which were later copypasted to other places. Anyway, GraphQL addon seems to work OK after my current changes.