Skip to content

Commit 452ad5e

Browse files
committed
refactor: we also want the pattern extension to include the full "extension"
1 parent 8e292d9 commit 452ad5e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/core/src/lib/object_factory.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,13 @@ const Pattern = function (
4646
patternlab?.config?.patternExtension?.includes('.') &&
4747
this.relPath.endsWith('.' + patternlab.config.patternExtension)
4848
) {
49-
this.fileName = path.basename(
50-
this.relPath,
51-
'.' + patternlab.config.patternExtension
52-
); // e.g. 'colors'
49+
this.fileExtension = '.' + patternlab.config.patternExtension; // e.g. '.html.twig'
50+
this.fileName = path.basename(this.relPath, this.fileExtension); // e.g. 'colors'
5351
} else {
52+
this.fileExtension = pathObj.ext; // e.g. '.hbs'
5453
this.fileName = pathObj.name; // e.g. 'colors'
5554
}
5655
this.subdir = pathObj.dir; // 'atoms/global'
57-
this.fileExtension = pathObj.ext; // '.hbs'
5856

5957
const info = this.getPatternInfo(
6058
pathObj,

0 commit comments

Comments
 (0)