diff --git a/src/utils/path-matcher.ts b/src/utils/path-matcher.ts index e52b62aa..05965ab0 100644 --- a/src/utils/path-matcher.ts +++ b/src/utils/path-matcher.ts @@ -75,7 +75,7 @@ export class ClassicPathMatcher { let fullName = str.slice(str.indexOf(strToMatch) + strToMatch.length, str.length).slice(0, -extName.length); if (type === 'component') { - if (['component', 'template', 'index', 'index-test', 'component-test', 'styles', 'module'].includes(fileName)) { + if (['component', 'template', 'index', 'index-test', 'component-test', 'style', 'styles', 'module'].includes(fileName)) { fullName = fullName.replace(`/${fileName}`, ''); } diff --git a/test/utils/path-matcher-test.ts b/test/utils/path-matcher-test.ts index 22536f68..6c7b633a 100644 --- a/test/utils/path-matcher-test.ts +++ b/test/utils/path-matcher-test.ts @@ -216,6 +216,7 @@ describe('ClassicPathMatcher', () => { }); expect(m('frontend/app/components/audio-player/styles.css')).toEqual({ type: 'component', name: 'audio-player', scope: 'application', kind: 'style' }); + expect(m('app/components/ui/bottom-container/style.css')).toEqual({ type: 'component', name: 'ui/bottom-container', scope: 'application', kind: 'style' }); expect(m('frontend/app/components/audio-player/styles.css')).toEqual({ type: 'component', name: 'audio-player', scope: 'application', kind: 'style' }); expect(m('frontend/app/components/audio-player/styles.scss')).toEqual({ type: 'component', name: 'audio-player', scope: 'application', kind: 'style' }); expect(m('frontend/app/components/audio-player/module.less')).toEqual({ type: 'component', name: 'audio-player', scope: 'application', kind: 'style' });