Create a local build of a standalone component, or all standalone components in a project, to validate component configuration, and to check for coding errors.
npm run buildComponent (builds a specific standalone component)npm run buildAllComponents (builds all standalone components in the source folder)The build command validates the component schema, performs linting, and bundles the component. These actions are also performed when publishing a component; however, build the component locally to ensure that it compiles without errors before publishing it to the server.
- If changes made to the config.json file are not validated, the validation of the component schema could fail during the building and publishing process. To prevent this, ensure that you validate any changes made to the config.json file. For detailed information on the structure and attributes of the config.json file, see Component definition.
- You might see warnings when linting is being performed. This will not prevent the process of publishing a component.
Result:
npm run buildAllComponents) automatically
executes the npm run buildComponent command for all standalone
components in your source folder. You can find the bundled standalone components in
the dist directory of your project's root
folder.