staticDist

  • function
 

Builds a static distributable which will eventually be copied to the static folder of the generated output.

.build.staticDist(options)

Builds the static distributable with the following steps:

  1. Copies everything from documentjs/site/default/static to documentjs/site/static/build.
  2. Overwrites site/static/build with content in options.static.
  3. Writes a package.json file to documentjs/site/static/build.
  4. Runs npm install in documentjs/site/static/build to get the dependencies for the build.
  5. Calls that "build" function at documentjs/site/static/build/build.js with the options and returns the result.

The "build" module is expected to build a minified distributable and copy the necessary contents to documentjs/site/static/dist and return a promise that resolves when complete.

Parameters

  1. options {Object}

    • forceBuild {Boolean}

      If set to true, rebuilds the static bundle even if it has already been built.

    • dest {String}

      The final destination ouput of the static distributable.

    • static {String}

      The location of static content used to overwrite or add to the default static content.

    • minifyBuild {Boolean}

      If set to false the build will not be minified. This behavior should be implemented by the "build" module.

Returns

{Promise}

A promise that resolves if the static dist was successfully created.