Sunday, October 16, 2022

[FIXED] How can I disable source maps in production for a vue.js app?

Issue

My app is created with the vue cli. I can't find any option to disable source maps in production. The npm build step in my package.json looks like this:

"build": "vue-cli-service build",

In angular, i can just add --prod to my build step to make it work. Is there any such option for vue.js? Or do I have to change the webpack config (which is hidden by the cli)?


Solution

You make changes to the internal webpack config with the vue.config.js file at the project root (you may need to create it manually).

There is a productionSourceMap option so you can disable source maps when building for production:

module.exports = {
  productionSourceMap: false
};


Answered By - yuriy636
Answer Checked By - Clifford M. (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.