hydrogen buildcommand
Builds a Hydrogen storefront for production. The client and app worker files are compiled to a /dist
folder in your Hydrogen project directory.
Anchor to flagsFlags
The following flags are available for the hydrogen build
command:
- Anchor to --bundle-stats--bundle-stats
Show a bundle size summary after building. Defaults to true, use
--no-bundle-stats
to disable.- 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 --disable-route-warning--disable-route-warningenv: SHOPIFY_HYDROGEN_FLAG_DISABLE_ROUTE_WARNING
Disables any warnings about missing standard routes.
- Anchor to --entry <value>--entry <value>stringenv: SHOPIFY_HYDROGEN_FLAG_ENTRY
Entry file for the worker. Defaults to
./server
.- Anchor to --force-client-sourcemap--force-client-sourcemapenv: SHOPIFY_HYDROGEN_FLAG_FORCE_CLIENT_SOURCEMAP
Client sourcemapping is avoided by default because it makes backend code visible in the browser. Use this flag to force enabling it.
- Anchor to --lockfile-check--lockfile-checkenv: SHOPIFY_HYDROGEN_FLAG_LOCKFILE_CHECK
Checks that there is exactly one valid lockfile in the project. Defaults to
true
. Deactivate with--no-lockfile-check
.- 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 --sourcemap--sourcemapenv: SHOPIFY_HYDROGEN_FLAG_SOURCEMAP
Controls whether server sourcemaps are generated. Default to
true
. Deactivate--no-sourcemaps
.- Anchor to --watch--watchenv: SHOPIFY_HYDROGEN_FLAG_WATCH
Watches for changes and rebuilds the project writing output to disk.
hydrogenbuild
- --bundle-stats
Show a bundle size summary after building. Defaults to true, use `--no-bundle-stats` to disable.
""
- --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
- --disable-route-warning
Disables any warnings about missing standard routes.
""
- --entry <value>
Entry file for the worker. Defaults to `./server`.
string
- --force-client-sourcemap
Client sourcemapping is avoided by default because it makes backend code visible in the browser. Use this flag to force enabling it.
""
- --lockfile-check
Checks that there is exactly one valid lockfile in the project. Defaults to `true`. Deactivate with `--no-lockfile-check`.
""
- --path <value>
The path to the directory of the Hydrogen storefront. Defaults to the current directory where the command is run.
string
- --sourcemap
Controls whether server sourcemaps are generated. Default to `true`. Deactivate `--no-sourcemaps`.
""
- --watch
Watches for changes and rebuilds the project writing output to disk.
""
export interface hydrogenbuild {
/**
* Show a bundle size summary after building. Defaults to true, use `--no-bundle-stats` to disable.
*
*/
'--bundle-stats'?: ''
/**
* 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
/**
* Disables any warnings about missing standard routes.
* @environment SHOPIFY_HYDROGEN_FLAG_DISABLE_ROUTE_WARNING
*/
'--disable-route-warning'?: ''
/**
* Entry file for the worker. Defaults to `./server`.
* @environment SHOPIFY_HYDROGEN_FLAG_ENTRY
*/
'--entry <value>'?: string
/**
* Client sourcemapping is avoided by default because it makes backend code visible in the browser. Use this flag to force enabling it.
* @environment SHOPIFY_HYDROGEN_FLAG_FORCE_CLIENT_SOURCEMAP
*/
'--force-client-sourcemap'?: ''
/**
* Checks that there is exactly one valid lockfile in the project. Defaults to `true`. Deactivate with `--no-lockfile-check`.
* @environment SHOPIFY_HYDROGEN_FLAG_LOCKFILE_CHECK
*/
'--lockfile-check'?: ''
/**
* 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
/**
* Controls whether server sourcemaps are generated. Default to `true`. Deactivate `--no-sourcemaps`.
* @environment SHOPIFY_HYDROGEN_FLAG_SOURCEMAP
*/
'--sourcemap'?: ''
/**
* Watches for changes and rebuilds the project writing output to disk.
* @environment SHOPIFY_HYDROGEN_FLAG_WATCH
*/
'--watch'?: ''
}
Hydrogen build
examples
hydrogen build
hydrogen build
shopify hydrogen build [flags]