kizu / bemto

Smart mixins for writing BEM in Pug
439 stars 66 forks source link

Pug unbuffered code don't includes #91

Open var-bp opened 7 years ago

var-bp commented 7 years ago

Hi, I have problem with bemto.pug when using with webpack 2 pug-loader. All files with only unbuffered code inside (helpers.pug and tag_metadata.pug) don't includes/compiles.

Only solution that I find is to take all unbuffered code from helpers.pug and tag_metadata.pug to index.pug and write it in one line each.

// don't work
-
  var get_bemto_tag_type = function(tagName) {
    var result = 'block'
    if (bemto_tag_metadata[tagName]) {
      result = bemto_tag_metadata[tagName].type || result;
    }
    return result;
  }

// work
- var get_bemto_tag_type = function(tagName) { var result = 'block'; if (bemto_tag_metadata[tagName]) { result = bemto_tag_metadata[tagName].type || result; } return result; }

It seems to me that the same problem should be with Gulp too. To write plugins it would be ideal if the bemto.pug was one big file.

kizu commented 7 years ago

That seems to be loaders' or pug's problem, but I have plans to compile pug automatically into one file before publishing to npm, when I'll get to it, this issue would be fixed I guess.

var-bp commented 7 years ago

Thank you so much 😄 .