Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed folder structure crushing in bem-xjst #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IkorJefocur
Copy link

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