diff --git a/.changeset/fast-lies-invite.md b/.changeset/fast-lies-invite.md new file mode 100644 index 0000000..7e7d05c --- /dev/null +++ b/.changeset/fast-lies-invite.md @@ -0,0 +1,5 @@ +--- +'@shopify/i18next-shopify': patch +--- + +Resolve Vite production issues by replacing `require` statement with `import` diff --git a/rollup.config.js b/rollup.config.js index 6845987..7a9353b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -38,6 +38,7 @@ const config = { copy({targets: [{src: './index.d.ts', dest: 'dist/types'}]}), ].concat(compress ? terser() : []), output, + external: ['react'], }; export default config; diff --git a/src/utils.js b/src/utils.js index 8644306..91569e1 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,4 +1,4 @@ -const {isValidElement, cloneElement} = require('react'); +import {isValidElement, cloneElement} from 'react'; const arr = []; const each = arr.forEach;