Build Command
Builds a theme to be uploaded to Shopify
#
Usage#
ConfigurationThe build
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 build 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#
--outputPathType: string
The output path of the generated files
#
--mainType: string
The main application file path
#
--tsConfigType: string
The path to the Typescript configuration file
#
--themekitConfigType: string
The path to the themekit config.yml configuration file
#
--postcssConfigType: string
The path to the PostCSS configuration file
#
--watchType: boolean
Run build when files change
#
--pollType: number
#
--vendorChunkType: boolean
Use a separate bundle containing only vendor libraries. (default: true)
#
--commonChunkType: boolean
Use a separate bundle containing code used across multiple bundles. (default: true)
#
--runtimeChunkType: boolean
Use a separate bundle containing the runtime. (default: true)
#
--sourceMapType: boolean
Produce source maps (default: true)
#
--outputHashingType: string
Configure webpack output hashing (default: none)
option | chunk | extract | file | script |
---|---|---|---|---|
none | โ | โ | โ | โ |
media | โ | โ | โ | โ |
bundles | โ | โ | โ | โ |
all | โ | โ | โ | โ |
#
--progressType: boolean
Log progress to the console while building
#
--assetsType: Array<string or AssetPattern>
List of static theme assets (default: [])
#
--analyzeType: boolean
Analyze the generated bundle and open webpack-bundle-analyzer in the browser
#
--statsJsonType: boolean
Generates a 'stats.json' file which can be analyzed using tools such as: #webpack-bundle-analyzer' or https://webpack.github.io/analyse
#
--verboseType: boolean
Emits verbose output
#
--extractLicensesType: boolean
Extract all licenses in a separate file, in the case of production builds only.
#
--optimizationType: boolean
Defines the optimization level of the build.
#
--showCircularDependenciesType: boolean
Show circular dependency warnings on builds. (default: true)
#
--memoryLimitType: number
Memory limit for type checking service process in MB. (defaults to 2048)
#
--fileReplacementsType: Array<FileReplacementPattern>
Replace files with other files in the build. (default: [])
#
--webpackConfigType: string
Path to a function which takes a webpack config, context and returns the resulting webpack config. See Extend Webpack Configuration to learn more.