code: function makeWriteFile(anonDefRegExp, namespaceWithDot, layer) {
          function writeFile(name, contents) {
              logger.trace('Saving plugin-optimized file: ' + name);
              file.saveUtf8File(name, contents);
          }
  
          writeFile.asModule = function (moduleName, fileName, contents) {
              writeFile(fileName,
                  build.toTransport(anonDefRegExp, namespaceWithDot, moduleName, fileName, contents, layer));
          };
  
          return writeFile;
      }
docs: Method used by plugin writeFile calls, defined up here to avoid jslint warning about "making a function in a loop".