Skip to content

What can i use instead of "pretty" option now? #106

Answered by webdiscus
GrishaKonshin asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @GrishaKonshin,

you can use the beforeEmit option for formatting generated html.

const path = require('path');
const PugPlugin = require('pug-plugin');

// module for formatting html, css, js
const pretty = require('js-beautify').html;

// formatting options: https://github.com/beautifier/js-beautify
const prettyOptions = {
  html: {
    indent_size: 2,
    end_with_newline: true,
    indent_inner_html: true,
    preserve_newlines: true,
    max_preserve_newlines: 0,
    wrap_line_length: 120,
    extra_liners: [],
    space_before_conditional: true,
    js: {
      end_with_newline: false,
      preserve_newlines: true,
      max_preserve_newlines: 2,
      space_after_anon_function: 

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by GrishaKonshin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants