Skip to content

Fixed folder structure crushing in bem-xjst#34

Open
IkorJefocur wants to merge 1 commit intobem:masterfrom
IkorJefocur:master
Open

Fixed folder structure crushing in bem-xjst#34
IkorJefocur wants to merge 1 commit intobem:masterfrom
IkorJefocur:master

Conversation

@IkorJefocur
Copy link
Copy Markdown

When new file object adding by "this.push" instead of changing input file, it's relative path changing. So when i using glob pattern like this: "\*\*/\*.bemjson.js", and have multiple folders with bemjson files, folder structure doesn't saves.

For example, i have gulp task like this:

gulp
	.src('layouts/**/*.bemjson.js')
	.pipe(toHtml(gulp
		.src(files.src.tmpls)
		.pipe(concat('blocks/*/*.bemhtml.js'))
		.pipe(bemhtml())
	))
	.pipe(gulp.dest('prod/layouts'));

And my folder structure:

layouts
 - pages
  - index.bemjson.js
 - parts
  - header.bemjson.js

In output, i will have structure like this:

layouts
 - index.html
 - header.html

I'm not pro in creating gulp plugins, but i tried to fix this problem just by changing path and contents of source ".bemjson" file, instead of creating new file. And it works! So now i have the same folder structure in input and output.

This is fixed output structure:

layouts
 - pages
  - index.html
 - parts
  - header.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant