-
Notifications
You must be signed in to change notification settings - Fork 264
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
Import prettier statically for bundling #2146
Conversation
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
We detected some changes in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me but would love for @frandiox to weigh in since he did it this way in the beginning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the reason to import it dynamically is that Prettier v2 is in CJS and it would slow down CLI startup. But since we are going to bundle it, it doesn't matter anymore 👍
* Use prettier.default to call prettier * Import prettier as a module * Format code
WHY are these changes introduced?
import('prettier')
) doesn't work well with esbuild bundlingWHAT is this pull request doing?
HOW to test your changes?
npx shopify hydrogen init
should trigger this code and workPost-merge steps
Checklist