function composeFilename(pattern, options) {
  let filename = pattern;

  filename = filename.replace(
    LOCAL_PLACEHOLDER_REGEX,
    (options && options.local) ? '$1' : ''
  );

  filename = filename.replace(
    NODE_ENV_PLACEHOLDER_REGEX,
    (options && options.node_env) ? `$1${options.node_env}$2` : ''
  );

  return filename;
}
Compose a filename from a given `patten`.

@param {string} pattern
@param {object} [options]
@param {boolean} [options.local]
@param {string} [options.node_env]
@return {string} filename