Nuxt.js: "collapseWhitespace: true"不生效

Created on 21 May 2019  ·  2Comments  ·  Source: nuxt/nuxt.js

Version

2.7.1

Steps to reproduce


build: {
        html: {
            minify: {
                collapseWhitespace: true
            }
        },
    },

What is expected ?

template
<span>a</span> <span>bc</span>

预期:
<span>a</span> <span>bc</span>

实际:
<span>a</span> <span>bc</span>

What is actually happening?

This bug report is available on Nuxt community (#c9243)
bug-report

Most helpful comment

you might want to use vue compiler options for that ( in build in your nuxt.config.js)

      loaders: {
        vue: {
          compilerOptions: {
            whitespace: 'condense'
          }
        }
      },

All 2 comments

you might want to use vue compiler options for that ( in build in your nuxt.config.js)

      loaders: {
        vue: {
          compilerOptions: {
            whitespace: 'condense'
          }
        }
      },

you might want to use vue compiler options for that ( in build in your nuxt.config.js)

      loaders: {
        vue: {
          compilerOptions: {
            whitespace: 'condense'
          }
        }
      },

谢谢 完美运行~!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaredreich picture jaredreich  ·  3Comments

pehbehbeh picture pehbehbeh  ·  3Comments

VincentLoy picture VincentLoy  ·  3Comments

vadimsg picture vadimsg  ·  3Comments

mikekidder picture mikekidder  ·  3Comments