From 452ad5ec792505df78b874d8360fcac1e9c1ae1a Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Wed, 28 Dec 2022 10:13:41 +0100 Subject: [PATCH] refactor: we also want the pattern extension to include the full "extension" --- packages/core/src/lib/object_factory.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/core/src/lib/object_factory.js b/packages/core/src/lib/object_factory.js index 2c258fcf1..a42ee51c3 100644 --- a/packages/core/src/lib/object_factory.js +++ b/packages/core/src/lib/object_factory.js @@ -46,15 +46,13 @@ const Pattern = function ( patternlab?.config?.patternExtension?.includes('.') && this.relPath.endsWith('.' + patternlab.config.patternExtension) ) { - this.fileName = path.basename( - this.relPath, - '.' + patternlab.config.patternExtension - ); // e.g. 'colors' + this.fileExtension = '.' + patternlab.config.patternExtension; // e.g. '.html.twig' + this.fileName = path.basename(this.relPath, this.fileExtension); // e.g. 'colors' } else { + this.fileExtension = pathObj.ext; // e.g. '.hbs' this.fileName = pathObj.name; // e.g. 'colors' } this.subdir = pathObj.dir; // 'atoms/global' - this.fileExtension = pathObj.ext; // '.hbs' const info = this.getPatternInfo( pathObj,