Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する
Command Reference

remove


The blocklet remove command is used to remove a component dependency from the current blocklet project. It modifies the blocklet.yml file by removing the specified component from the components array.

This command is the inverse of blocklet add. For a more comprehensive guide on managing dependencies, see Compose Components.

Usage#

To remove a component, run the command from within your blocklet's root directory.

blocklet remove <component-name>

Arguments#

The command takes one required argument:

Argument

Description

<component-name>

Required. The name of the component to remove. This name must exactly match an entry in the components array of your blocklet.yml file.

How It Works#

The remove command follows a simple workflow to ensure the component is safely removed from your project's metadata.

blocklet.ymlCLIUserblocklet.ymlCLIUseralt[Component Found][Component Not Found]blocklet remove my-componentRead blocklet.ymlReturn file contentParse metadataFilter out 'my-component' from components arrayWrite updated metadata to blocklet.ymlConfirm writePrint success messagePrint error: "Cannot find component..."

Example#

Imagine your blocklet.yml file lists two components that your blocklet depends on:

name: my-app
version: 1.0.0
# ... other metadata
components:
- name: my-chart-component
did: "zd......"
- name: my-auth-component
did: "zd......"

You decide you no longer need my-chart-component.

Command#

Run the following command in your terminal:

blocklet remove my-chart-component

Result#

The CLI will display a success message:

Component my-chart-component was successfully removed

After the command executes, your blocklet.yml file is automatically updated:

name: my-app
version: 1.0.0
# ... other metadata
components:
- name: my-auth-component
did: "zd......"

The my-chart-component entry has been removed from the components list.


Now that you know how to remove components, you may want to learn how to add them back or explore other commands for managing your blocklet. See blocklet add for adding dependencies or browse the full list of blocklet commands.