Skip to content

Commit ee6d972

Browse files
committed
fix(@ngtools/webpack): dont error on non-identifier properties.
1 parent c783968 commit ee6d972

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/@ngtools/webpack/src/loader.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ function _removeModuleId(refactor: TypeScriptFileRefactor) {
9797
refactor.findAstNodes(sourceFile, ts.SyntaxKind.ObjectLiteralExpression, true)
9898
// Get all their property assignments.
9999
.filter((node: ts.ObjectLiteralExpression) =>
100-
node.properties.some(prop => prop.name.getText() == 'moduleId'))
100+
node.properties.some(prop => _getContentOfKeyLiteral(sourceFile, prop.name) == 'moduleId'))
101101
.forEach((node: ts.ObjectLiteralExpression) => {
102102
const moduleIdProp = node.properties.filter((prop: ts.ObjectLiteralElement, idx: number) => {
103-
return prop.name.getText() == 'moduleId';
103+
return _getContentOfKeyLiteral(sourceFile, prop.name) == 'moduleId';
104104
})[0];
105105
// get the trailing comma
106106
const moduleIdCommaProp = moduleIdProp.parent.getChildAt(1).getChildren()[1];

0 commit comments

Comments
 (0)