vb-require-bundle

Creates minified requirejs module bundles.

The following table describes the subtasks, hooks, and inputs and outputs of the vb-require-bundle task:

Detail Description
subtasks n/a
multitask config generator task: vb-require-bundle-configuration
hooks n/a
input build/optimized/*
output build/optimized/*

The following tables describe the options for the vb-require-bundle task.

Build option

Name Mandatory Default Value Description
target no build Name of build directory.

Optimization options

Name Mandatory Default Value Description
emptyPaths no n/a Comma-separated list of require paths that are set "empty". Requirejs optimizer will not follow and bundle matching dependencies.
requirePaths no n/a

Requirejs optimizer paths mapping. This will override any default values or values read from app-flow.json.

The value needs to be in a form of quoted JSON object: (--requirePaths='{ "foo": "boo" }').

bundles no  

Defines custom require module bundles.

Configuration schema:

  • <bundle name>
    • modules
      • find
      • ids
    • exclude
      • find
      • ids
bundles.modules no  

Specification of the modules that are to be added to the enclosing bundle element.

Configuration schema:

  • find
  • ids
bundles.exclude no  

Specify modules that shouldn't be part of the enclosing modules bundle. The exclusions are applied to all bundle modules, including modules added following transitive module dependencies.

Configuration schema:

  • find
  • ids
bundles.[exclude|modules].find no  

List of regular expression patterns used for matching optimized application resources.

Regular expressions starting with exclamation mark are considered to be negative; resources matching these patterns won't be included.

bundles.[exclude|modules].ids no   Specifies list of module IDs.
transpile no false

Determines whether a separate set of require module bundles transpiled to ES5 code using babel preset-env preset should be created and stored in the bundles/es5 directory.

When this option is set to true, the application's index.html is modified so it contains a code snippet that switches between the original bundles for modern browsers and the ES5 versions for IE11.

minify

no true When set to true, babel minify preset is used to minify generated requirejs module bundles. The minification is also applied to the ES5 variants of the bundles if created.
optimize no  

Deprecated. You should use the minify option instead.

include no n/a

Deprecated. You should use the bundles option instead.

exclude no n/a

Deprecated. You should use the bundles option instead.