diff --git a/src/AureliaDependenciesPlugin.ts b/src/AureliaDependenciesPlugin.ts index 35388c0..f87d8ea 100644 --- a/src/AureliaDependenciesPlugin.ts +++ b/src/AureliaDependenciesPlugin.ts @@ -44,7 +44,7 @@ class ParserPlugin { parser.plugin("evaluate Identifier imported var.moduleName", (expr: Webpack.MemberExpression) => { if (expr.property.name === "moduleName" && expr.object.name === "PLATFORM" && - expr.object.type === "Identifier") { + String(expr.object.type) === "Identifier") { return new BasicEvaluatedExpression().setIdentifier("PLATFORM.moduleName").setRange(expr.range); } return undefined; @@ -58,8 +58,8 @@ class ParserPlugin { // PLATFORM.moduleName("id"); parser.plugin("evaluate MemberExpression", (expr: Webpack.MemberExpression) => { if (expr.property.name === "moduleName" && - (expr.object.type === "MemberExpression" && expr.object.property.name === "PLATFORM" || - expr.object.type === "Identifier" && expr.object.name === "PLATFORM")) { + (String(expr.object.type) === "MemberExpression" && expr.object.property.name === "PLATFORM" || + String(expr.object.type) === "Identifier" && expr.object.name === "PLATFORM")) { return new BasicEvaluatedExpression().setIdentifier("PLATFORM.moduleName").setRange(expr.range); } return undefined; diff --git a/src/PreserveModuleNamePlugin.ts b/src/PreserveModuleNamePlugin.ts index 8d5181a..2f75a13 100644 --- a/src/PreserveModuleNamePlugin.ts +++ b/src/PreserveModuleNamePlugin.ts @@ -56,6 +56,7 @@ export class PreserveModuleNamePlugin { } // Metadata? + moduleId = moduleId.replace(/\\/g, '/'); if (module.meta) { module.meta['aurelia-id'] = moduleId; }