refactor(all): add index.ts, and build using es2015 and UMD bundles. (#1158)

This commit is contained in:
Hans
2016-09-01 22:04:14 -07:00
committed by Kara
parent 3669f06201
commit 818290ba75
94 changed files with 330 additions and 170 deletions
+12
View File
@@ -47,6 +47,7 @@ function inlineResources(globs) {
readFile(filePath, 'utf-8')
.then(content => inlineTemplate(filePath, content))
.then(content => inlineStyle(filePath, content))
.then(content => removeModuleId(filePath, content))
.then(content => writeFile(filePath, content))
.catch(err => {
console.error('An error occured: ', err);
@@ -104,4 +105,15 @@ function inlineStyle(filePath, content) {
}
/**
* Remove every mention of `moduleId: module.id`.
* @param _ {string} The file path of the source file, currently ignored.
* @param content {string} The source file's content.
* @returns {string} The content with all moduleId: mentions removed.
*/
function removeModuleId(_, content) {
return content.replace(/\s*moduleId:\s*module\.id\s*,?\s*/gm, '');
}
module.exports = inlineResources;