S
S
Sergey Sokolov2019-01-30 19:47:34
webpack
Sergey Sokolov, 2019-01-30 19:47:34

How to keep quotes around attributes in vue-cli-service build?

I am using vuecli . Created a project, everything by default, saved, made build.
In the final index.htmlresult of minification, quotes around all attributes were removed, incl. Script URLs.
How to return them? It seems that the html-loader option
is responsible for this . For more information about these options, see the html-minifier documentation . How can I add this option to my config? Create a file - I'm stuck here, I don't understand how to register it. There are no mentions of "html-loader" and "html-minfier" in the dump. removeAttributeQuotes
vue.config.jsvue inspect

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-01-30
@sergiks

vue.config.js:

module.exports = {
  chainWebpack: config => {
    config
      .plugin('html')
      .tap(args => {
        args[0].minify.removeAttributeQuotes = false;
        return args;
      })
  }
};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question