Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable source map or debug mode in production Vue.js - Webpack

Tags:

webpack

vue.js

I am working on a Vue.js project and all files are generated by webpack on dev and production mode.

but here is my problem :

I can see my vue components in devtools when I inspect on a element.

How could I disable that ?

By the way source map is disabled and I have no .map files in dist folder. Here is my devtools and as you can see vue components are showed

thank you :)

like image 437
Hamid Avatar asked Nov 30 '22 14:11

Hamid


1 Answers

Just checkout the Vue cli docs:

productionSourceMap Type: boolean

Default: true

Setting this to false can speed up production builds if you don't need source maps for production.

So in your webpack config you write:

module.exports = {
  productionSourceMap: false
};

If your vue.config.js which is responsible for your webpack configuration doesn't exist, you may create it.

like image 64
Christopher Dosin Avatar answered Dec 04 '22 06:12

Christopher Dosin