How to disable minified in vue-cli?
Asked Answered
S

1

9

I wanna the production code is not minified in dist/ with @vue/cli 4.1.2

1、first try set vue.config.js

module.exports = {
  chainWebpack: config => {
  config.optimization.minimize(false)
  }
}

and then other parts is normal, but the inline script still be minified.

var Appvue_type_template_id_7a951895_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"app"}},[_c('img',{attrs:{"alt":"Vue logo","src":__webpack_require__("cf05")}}),_c('HelloWorld',{attrs:{"msg":"Welcome to Your Vue.js App"}})],1)}

2、 second try

use dev mode vue-cli-service build --mode development

but the code format is eval(...)

Sunsunbaked answered 31/12, 2019 at 6:30 Comment(0)
M
-1

have a try to delete the plugin like: config.optimization.minimizers.delete(name) vue inspect --plugins to check plugin names maybe terser?

Meant answered 28/6, 2023 at 4:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.