Fix Hydrogen webpack build and editor link keys
This commit is contained in:
@@ -54,9 +54,9 @@ const Footer: React.FC<FooterProps> = ({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<nav className="flex flex-wrap items-center justify-center gap-x-5 gap-y-2 sm:justify-start">
|
<nav className="flex flex-wrap items-center justify-center gap-x-5 gap-y-2 sm:justify-start">
|
||||||
{links.map((link) => (
|
{links.map((link, index) => (
|
||||||
<a
|
<a
|
||||||
key={link.label}
|
key={`${link.url}-${index}`}
|
||||||
href={link.url}
|
href={link.url}
|
||||||
className="text-sm text-muted-foreground hover:text-foreground transition-colors"
|
className="text-sm text-muted-foreground hover:text-foreground transition-colors"
|
||||||
>
|
>
|
||||||
|
|||||||
+9
-1
@@ -27,8 +27,16 @@ export default {
|
|||||||
experimental: {
|
experimental: {
|
||||||
reactDebugChannel: false,
|
reactDebugChannel: false,
|
||||||
},
|
},
|
||||||
webpack: (config, { isServer }) => {
|
webpack: (config, { isServer, webpack }) => {
|
||||||
config.cache = { type: 'memory' };
|
config.cache = { type: 'memory' };
|
||||||
|
// Hydrogen's root entry imports this browser-only analytics module by URL.
|
||||||
|
// Webpack resolves it before tree-shaking and otherwise rejects the https: scheme.
|
||||||
|
config.plugins.push(
|
||||||
|
new webpack.IgnorePlugin({
|
||||||
|
resourceRegExp:
|
||||||
|
/^https:\/\/cdn\.shopify\.com\/storefront\/standard-events\.js$/,
|
||||||
|
})
|
||||||
|
);
|
||||||
if (isServer) {
|
if (isServer) {
|
||||||
config.optimization = config.optimization || {};
|
config.optimization = config.optimization || {};
|
||||||
config.optimization.splitChunks = false;
|
config.optimization.splitChunks = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user