Serve Command
Serves a theme for local development. Creates a local assets server and proxies the theme preview using a BrowserSync instance.
#
Usage#
ConfigurationThe serve
command is configured as a project target in the workspace.json
file at your workspace root. By default, the target configuration should look similar to this:
The serve target comes with a default production
configuration that can be executed with:
You can add additional configurations that define new options or override the ones defined in the default options object.
tip
Learn more about Nx targets configurations at the Nx website
You can also override/define options passing them as CLI arguments, these will take precedence over the workspace.json
configurations.
Example:
#
Options#
--buildTargetType: string
Name of the target to be used in the theme build process.
#
--analyzeType: boolean
Analyze the generated bundle and open webpack-bundle-analyzer in the browser
#
--themekitEnvType: string
Name of the themekit config.yml environment to be used in the deployment (default: development)
#
--allowLiveType: boolean
Enables making changes to the Shopify Live Theme
#
--openType: boolean
Open theme preview in the broswer when the deployment is done.
#
--skipFirstDeployType: boolean
Tell if the first deploy should be skipped.
#
--devServerIpAddressType: string
Set the local web server ip address. Valid values are: private (default), public, "interface name", "ip v4/6 address" (default: private)
#
--proxyConfigType: string
Path to the proxy configuration file to be used