## DESCRIPTION:

Outputs bundle definition from the Backbase server for the given item.
Bundle definition can then be used as input for bb-bundle create command.

Defining your bundles can be a complicated process. There are many different ways
to optimize your bundling depending on how your portal/pages/widgets are
constructed.

Once you have created your bundle definition file/s, you can use `bb-bundle create`
to create the actual bundles.

These examples show some common use-cases for bundling your project:

## EXAMPLES:

Scenario 1: Create bundles for each entire portal:

```
bb-bundle define --bundle-by portal --portal-name portal-a --output portal-a.json
```

Scenario 2: Create a bundle for every portal page:

```
bb-bundle define --bundle-by page --portal-name portal-a --output pages-bundles.json
```

Scenario 3: Create a bundle for specific pages:

```
# First create the page bundles:
bb-bundle define --bundle-by page --portal-name portal-a --page-names page-1,page-2 --output pages-bundles.json

# Create a fallback bundle for the rest of the portal
bb-bundle define --bundle-by portal --portal-name portal-a --exclude-pages page-1,page-2 --output portal-a.json
```

Scenario 4: Bundle per portal page, plus a common bundle for common widgets/features:

```
# First create a common bundle for the commonly used widgets/features:
bb-bundle define --bundle-by item --item-nameswidget-a,widget-b,feature-b --output common-bundle.json

# Create bundles for portal pages, excluding what's in the common-bundle.json
bb-bundle define --bundle-by page --portal-name portal-a --page-names page-1,page-2 --exclude-items widget-a,widget-b,feature-b \
  --output pages-bundle.json

# Create a fallback bundle for the rest of the portal
bb-bundle define --bundle-by portal --portal-name portal-a --exclude-pages page-1,page-2 --exclude-items widget-a,widget-b,feature-b \
  --output portal-a.json
```
