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

netlify/hydrogen-platform

Repository files navigation

⚠️ This package is deprecated. See the new template to deploy Hydrogen to Netlify

This package is a Hydrogen platform that allows you to deploy your site to Netlify Edge Functions.

Installation

npm i -D @netlify/hydrogen-platform

Then add the plugin to your Vite config:

// vite.config.js

import { defineConfig } from 'vite'
import hydrogen from '@shopify/hydrogen/plugin'
import netlifyPlugin from '@netlify/hydrogen-platform/plugin'

export default defineConfig({
  plugins: [hydrogen(), netlifyPlugin()],
  //   ...
})

Then when you run shopify hydrogen build it will generate the correct files to deploy to Netlify Edge.

Netlify detects Hydrogen sites, so you should have the correct settings already, but if you need to set them manually you can use the netlify.toml or Netlify UI to do so:

# netlify.toml
[build]
command = "npm run build"
publish = "dist/client"