code: function inlineResources(projectPath) {
  
    // Match only TypeScript files in projectPath.
    const files = glob.sync('**/*.ts', {cwd: projectPath});
  
    // For each file, inline the templates and styles under it and write the new file.
    return Promise.all(files.map(filePath => {
      const fullFilePath = path.join(projectPath, filePath);
      return readFile(fullFilePath, 'utf-8')
        .then(content => inlineResourcesFromString(content, url => {
          // Resolve the template url.
          return path.join(path.dirname(fullFilePath), url);
        }))
        .then(content => writeFile(fullFilePath, content))
        .catch(err => console.error('An error occured: ', err));
    }));
  }
docs: Inline resources in a tsc/ngc compilation.
  @param { string } projectPath Path to the project.