Runs a Hydrogen storefront in a local runtime that emulates an Oxygen worker for development. If your project is [linked](/docs/api/shopify-cli/hydrogen/hydrogen-link) to a Hydrogen storefront, then its environment variables will be loaded with the runtime.
shopify hydrogen dev [flags]
The following flags are available for the `hydrogen dev` command:
Automatically generates GraphQL types for your project’s Storefront API queries.
Specifies a path to a codegen configuration file. Defaults to `<root>/codegen.ts` if this file exists.
env: SHOPIFY_HYDROGEN_FLAG_DEBUG
Enables inspector connections to the server with a debugger such as Visual Studio Code or Chrome DevTools.
env: SHOPIFY_HYDROGEN_FLAG_DISABLE_DEPS_OPTIMIZER
Disable adding dependencies to Vite's `ssr.optimizeDeps.include` automatically
Skip the version check when running `hydrogen dev`
env: SHOPIFY_HYDROGEN_FLAG_DISABLE_VIRTUAL_ROUTES
Disable rendering fallback routes when a route file doesn't exist.
env: SHOPIFY_HYDROGEN_FLAG_ENTRY
Entry file for the worker. Defaults to `./server`.
Specifies the environment to perform the operation using its handle. Fetch the handle using the `env list` command.
env: SHOPIFY_HYDROGEN_ENVIRONMENT_BRANCH
Specifies the environment to perform the operation using its Git branch name.
Path to an environment file to override existing environment variables. Defaults to the '.env' located in your project path `--path`.
Expose the server to the local network
env: SHOPIFY_HYDROGEN_FLAG_INSPECTOR_PORT
The port where the inspector is available. Defaults to 9229.
env: SHOPIFY_HYDROGEN_FLAG_LEGACY_RUNTIME
[Classic Remix Compiler] Runs the app in a Node.js sandbox instead of an Oxygen worker.
env: SHOPIFY_HYDROGEN_FLAG_PATH
The path to the directory of the Hydrogen storefront. Defaults to the current directory where the command is run.
env: SHOPIFY_HYDROGEN_FLAG_PORT
The port to run the server on. Defaults to 3000.
env: SHOPIFY_HYDROGEN_FLAG_SOURCEMAP
[Classic Remix Compiler] Controls whether server sourcemaps are generated. Default to `true`. Deactivate `--no-sourcemaps`.
env: SHOPIFY_HYDROGEN_FLAG_VERBOSE
Outputs more information about the command's execution.