Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Update the umd global variable name (#159)
Browse files Browse the repository at this point in the history
* Update the umd global variable name

* add changeset
  • Loading branch information
frehner committed Feb 2, 2023
1 parent 3ab603c commit b8757bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-carrots-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen-react': patch
---

Fix the UMD global variable name from `storefrontkitreact` to `hydrogenreact`.
2 changes: 1 addition & 1 deletion packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Depending on the bundler or runtime that you're using, the correct bundle might

Hydrogen React has a development `umd` build and a production `umd` build. Both are meant to be used directly either by `<script src=""></script>` tags in HTML or by `AMD`-compatible loaders.

If you're using Hydrogen React as a global through the `<script>` tag, then the components can be accessed through the `storefrontkitreact` global variable.
If you're using Hydrogen React as a global through the `<script>` tag, then the components can be accessed through the `hydrogenreact` global variable.

## Enable Storefront API GraphQL autocompletion

Expand Down
2 changes: 1 addition & 1 deletion packages/react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig(({mode, ssrBuild}) => {
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'storefrontkitreact',
name: 'hydrogenreact',
fileName: () =>
`hydrogen-react.${mode === 'umdbuilddev' ? 'dev' : 'prod'}.js`,
formats: ['umd'],
Expand Down

0 comments on commit b8757bd

Please sign in to comment.