From dd0229ea15ee3bb7857cf12aaf321f96294c628c Mon Sep 17 00:00:00 2001 From: cruperman Date: Fri, 5 Feb 2021 16:14:43 +0300 Subject: [PATCH] fix: fix broken sources --- src/core/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/utils.ts b/src/core/utils.ts index dbac7a0..bf0fd60 100644 --- a/src/core/utils.ts +++ b/src/core/utils.ts @@ -1,9 +1,11 @@ +import { basename } from 'path' import normalize from 'normalize-path' import { Platforms } from '../core/platforms' export function getPlatformFromFilePath(filePath: string): Platforms { - const matched = filePath.match(/@([\w|-]+)+\./) + const fileName = basename(filePath) + const matched = fileName.match(/@([\w|-]+)+\./) return matched === null ? 'common' : (matched[1] as Platforms) }