hydrogen devcommand
Runs a Hydrogen storefront in a local runtime that emulates an Oxygen worker for development.
If your project is linked to a Hydrogen storefront, then its environment variables will be loaded with the runtime.
Anchor to flagsFlags
The following flags are available for the hydrogen dev
command:
- Anchor to --codegen--codegen
Automatically generates GraphQL types for your project’s Storefront API queries.
- Anchor to --codegen-config-path <value>--codegen-config-path <value>string
Specifies a path to a codegen configuration file. Defaults to
<root>/codegen.ts
if this file exists.- Anchor to --debug--debugenv: SHOPIFY_HYDROGEN_FLAG_DEBUG
Enables inspector connections to the server with a debugger such as Visual Studio Code or Chrome DevTools.
- Anchor to --disable-deps-optimizer--disable-deps-optimizerenv: SHOPIFY_HYDROGEN_FLAG_DISABLE_DEPS_OPTIMIZER
Disable adding dependencies to Vite's
automatically
- Anchor to --disable-version-check--disable-version-check
Skip the version check when running
hydrogen dev
- Anchor to --disable-virtual-routes--disable-virtual-routesenv: SHOPIFY_HYDROGEN_FLAG_DISABLE_VIRTUAL_ROUTES
Disable rendering fallback routes when a route file doesn't exist.
- Anchor to --entry <value>--entry <value>stringenv: SHOPIFY_HYDROGEN_FLAG_ENTRY
Entry file for the worker. Defaults to
./server
.- Anchor to --env <value>--env <value>string
Specifies the environment to perform the operation using its handle. Fetch the handle using the
env list
command.- Anchor to --env-branch <value>--env-branch <value>stringenv: SHOPIFY_HYDROGEN_ENVIRONMENT_BRANCH
Specifies the environment to perform the operation using its Git branch name.
- Anchor to --env-file <value>--env-file <value>string
Path to an environment file to override existing environment variables. Defaults to the '.env' located in your project path
--path
.- Anchor to --host--host
Expose the server to the local network
- Anchor to --inspector-port <value>--inspector-port <value>stringenv: SHOPIFY_HYDROGEN_FLAG_INSPECTOR_PORT
The port where the inspector is available. Defaults to 9229.
- Anchor to --path <value>--path <value>stringenv: SHOPIFY_HYDROGEN_FLAG_PATH
The path to the directory of the Hydrogen storefront. Defaults to the current directory where the command is run.
- Anchor to --port <value>--port <value>stringenv: SHOPIFY_HYDROGEN_FLAG_PORT
The port to run the server on. Defaults to 3000.
- Anchor to --verbose--verboseenv: SHOPIFY_HYDROGEN_FLAG_VERBOSE
Outputs more information about the command's execution.
hydrogendev
- --codegen
Automatically generates GraphQL types for your project’s Storefront API queries.
""
- --codegen-config-path <value>
Specifies a path to a codegen configuration file. Defaults to `<root>/codegen.ts` if this file exists.
string
- --debug
Enables inspector connections to the server with a debugger such as Visual Studio Code or Chrome DevTools.
""
- --disable-deps-optimizer
Disable adding dependencies to Vite's `ssr.optimizeDeps.include` automatically
""
- --disable-version-check
Skip the version check when running `hydrogen dev`
""
- --disable-virtual-routes
Disable rendering fallback routes when a route file doesn't exist.
""
- --entry <value>
Entry file for the worker. Defaults to `./server`.
string
- --env <value>
Specifies the environment to perform the operation using its handle. Fetch the handle using the `env list` command.
string
- --env-branch <value>
Specifies the environment to perform the operation using its Git branch name.
string
- --env-file <value>
Path to an environment file to override existing environment variables. Defaults to the '.env' located in your project path `--path`.
string
- --host
Expose the server to the local network
""
- --inspector-port <value>
The port where the inspector is available. Defaults to 9229.
string
- --path <value>
The path to the directory of the Hydrogen storefront. Defaults to the current directory where the command is run.
string
- --port <value>
The port to run the server on. Defaults to 3000.
string
- --verbose
Outputs more information about the command's execution.
""
export interface hydrogendev {
/**
* Automatically generates GraphQL types for your project’s Storefront API queries.
*
*/
'--codegen'?: ''
/**
* Specifies a path to a codegen configuration file. Defaults to `<root>/codegen.ts` if this file exists.
*
*/
'--codegen-config-path <value>'?: string
/**
* Enables inspector connections to the server with a debugger such as Visual Studio Code or Chrome DevTools.
* @environment SHOPIFY_HYDROGEN_FLAG_DEBUG
*/
'--debug'?: ''
/**
* Disable adding dependencies to Vite's `ssr.optimizeDeps.include` automatically
* @environment SHOPIFY_HYDROGEN_FLAG_DISABLE_DEPS_OPTIMIZER
*/
'--disable-deps-optimizer'?: ''
/**
* Skip the version check when running `hydrogen dev`
*
*/
'--disable-version-check'?: ''
/**
* Disable rendering fallback routes when a route file doesn't exist.
* @environment SHOPIFY_HYDROGEN_FLAG_DISABLE_VIRTUAL_ROUTES
*/
'--disable-virtual-routes'?: ''
/**
* Entry file for the worker. Defaults to `./server`.
* @environment SHOPIFY_HYDROGEN_FLAG_ENTRY
*/
'--entry <value>'?: string
/**
* Specifies the environment to perform the operation using its handle. Fetch the handle using the `env list` command.
*
*/
'--env <value>'?: string
/**
* Specifies the environment to perform the operation using its Git branch name.
* @environment SHOPIFY_HYDROGEN_ENVIRONMENT_BRANCH
*/
'--env-branch <value>'?: string
/**
* Path to an environment file to override existing environment variables. Defaults to the '.env' located in your project path `--path`.
*
*/
'--env-file <value>'?: string
/**
* Expose the server to the local network
*
*/
'--host'?: ''
/**
* The port where the inspector is available. Defaults to 9229.
* @environment SHOPIFY_HYDROGEN_FLAG_INSPECTOR_PORT
*/
'--inspector-port <value>'?: string
/**
* The path to the directory of the Hydrogen storefront. Defaults to the current directory where the command is run.
* @environment SHOPIFY_HYDROGEN_FLAG_PATH
*/
'--path <value>'?: string
/**
* The port to run the server on. Defaults to 3000.
* @environment SHOPIFY_HYDROGEN_FLAG_PORT
*/
'--port <value>'?: string
/**
* Outputs more information about the command's execution.
* @environment SHOPIFY_HYDROGEN_FLAG_VERBOSE
*/
'--verbose'?: ''
}
Hydrogen dev
examples
hydrogen dev
hydrogen dev
shopify hydrogen dev [flags]