Skip to content

Commit 7f594ce

Browse files
devversionjelbourn
authored andcommitted
fix(build): omit module ids from component metadata. (#984)
> Removes the module ids of the component metadata. > Since the templates and styles are now inlined, the module id has become unnecessary and > can cause unexpected issues This also fixes #974 in meanwhile.
1 parent 6e99d90 commit 7f594ce

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/release/inline-resources.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ for (let arg of process.argv.slice(2)) {
4646
readFile(filePath, 'utf-8')
4747
.then(content => inlineTemplate(filePath, content))
4848
.then(content => inlineStyle(filePath, content))
49+
.then(content => removeModuleIds(content))
4950
.then(content => writeFile(filePath, content))
5051
.catch(err => {
5152
console.error('An error occured: ', err);
@@ -96,3 +97,13 @@ function inlineStyle(filePath, content) {
9697
+ ']';
9798
});
9899
}
100+
101+
/**
102+
* Removes the module ids of the component metadata.
103+
* Since the templates and styles are now inlined, the module id has become unnecessary and
104+
* can cause unexpected issues.
105+
*/
106+
function removeModuleIds(content) {
107+
// Match the line feeds as well, because we want to get rid of that line.
108+
return content.replace(/^\W+moduleId:\W+module\.id,?[\n|\r]+/gm, '');
109+
}

0 commit comments

Comments
 (0)