itgalaxy / nunjucks-webpack-plugin

A webpack plugin for nunjucks.
MIT License
27 stars 12 forks source link

Html beautifier after render #18

Open 4m1n0s opened 4 years ago

4m1n0s commented 4 years ago

after rendering nunjucks files to html, the result files are not well formatted,

i fixed this issue using prettier

        const prettier = require('prettier');
        ........
        const res = prettier.format(configure.render(
          template.from,
          Object.assign(baseContext, template.context),
          template.callback ? template.callback : null
        ), { parser: 'vue', useTabs: true, tabWidth: 4 });

not sure if it's a correct fix or not !