mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(all): add index.ts, and build using es2015 and UMD bundles. (#1158)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user