CCD-102 practice question 19 of 30
In order to build the SFRA code to a developer sandbox for the first time, which build steps should the developer perform for the site to appear and function as designed?
Full set: 206 questionsTo build the Storefront Reference Architecture (SFRA) for the first time, the developer must compile all necessary front-end assets. The npm run compile:js script compiles the JavaScript files required for site functionality and interactivity. The npm run compile:scss script compiles the SASS files into CSS for styling and visual appearance. The npm run compile:fonts script processes the font files necessary for the site's typography. These three commands, often bundled into a single npm run build command, ensure the storefront appears and functions as designed.
1. Salesforce Developers Documentation
Set Up the Storefront Reference Architecture: The setup guide outlines the build process. The build command is a composite of the individual compile tasks. The documentation states
"To compile your code and upload it to the server
you can run the npm run build command." The underlying scripts that constitute the build are for JS
SCSS
and other assets like fonts.
Reference: Salesforce B2C Commerce Developer Documentation
"Set Up Your Local SFRA Environment" section.
2. Official SFRA GitHub Repository
package.json: The package.json file in the root of the official storefront-reference-architecture repository explicitly defines the build scripts. The main build script is defined as: "build": "npm run compile:js && npm run compile:scss && npm run compile:fonts". This directly confirms that these three compilation steps are the required components for a standard build.
Reference: package.json
scripts object
in the main branch of the salesforce/storefront-reference-architecture GitHub repository.
3. Salesforce Trailhead
Develop for Salesforce B2C Commerce: The "Customize the Storefront" module explains the asset compilation process. It details how JavaScript and CSS (compiled from SCSS) are bundled and uploaded to the sandbox
which is accomplished via the npm build scripts.
Reference: Salesforce Trailhead
"Salesforce B2C Commerce SFRA" trail
"Customize the Storefront" module.
Keep practicing
Take the free CCD-102 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CCD-102 practice questions
- Question 1A developer has a sandbox with code to log a message during execution, and the following …
- Question 3Server.get(‘Show’, consentTracking.consent, cache.applyDefaultCache, function (req,res,ne…
- Question 4A developer needs to update the package.json file so that it points to the hock file for …
- Question 5A developer wants to create in Business Manager extension with the cartridge named plugin…
- Question 6A client uses tax tables in Business Manager to calculate tax. They recently started ship…
- Question 7A Digital Developer has a site export file on their computer that needs to be imported in…
