hydrogen generate routecommand
Generates a set of default routes from the starter template.
Anchor to flagsFlags
The following flags are available for the hydrogen generate route
command:
- Anchor to --adapter <value>--adapter <value>stringenv: SHOPIFY_HYDROGEN_FLAG_ADAPTER
Remix adapter used in the route. The default is
.
- Anchor to --locale-param <value>--locale-param <value>stringenv: SHOPIFY_HYDROGEN_FLAG_ADAPTER
The param name in Remix routes for the i18n locale, if any. Example:
locale
becomes ($locale).- 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 --typescript--typescriptenv: SHOPIFY_HYDROGEN_FLAG_TYPESCRIPT
Generate TypeScript files
- Anchor to -f, --force-f, --forceenv: SHOPIFY_HYDROGEN_FLAG_FORCE
Overwrites the destination directory and files if they already exist.
hydrogengenerateroute
- --adapter <value>
Remix adapter used in the route. The default is `@shopify/remix-oxygen`.
string
- --locale-param <value>
The param name in Remix routes for the i18n locale, if any. Example: `locale` becomes ($locale).
string
- --path <value>
The path to the directory of the Hydrogen storefront. Defaults to the current directory where the command is run.
string
- --typescript
Generate TypeScript files
""
- -f, --force
Overwrites the destination directory and files if they already exist.
""
export interface hydrogengenerateroute {
/**
* Remix adapter used in the route. The default is `@shopify/remix-oxygen`.
* @environment SHOPIFY_HYDROGEN_FLAG_ADAPTER
*/
'--adapter <value>'?: string
/**
* Overwrites the destination directory and files if they already exist.
* @environment SHOPIFY_HYDROGEN_FLAG_FORCE
*/
'-f, --force'?: ''
/**
* The param name in Remix routes for the i18n locale, if any. Example: `locale` becomes ($locale).
* @environment SHOPIFY_HYDROGEN_FLAG_ADAPTER
*/
'--locale-param <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
/**
* Generate TypeScript files
* @environment SHOPIFY_HYDROGEN_FLAG_TYPESCRIPT
*/
'--typescript'?: ''
}
Hydrogen generate route
examples
hydrogen generate route
hydrogen generate route
shopify hydrogen generate route [flags]