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)?
Source map generation is controlled through Webpack configuration, more specifically in the devtool option. In a nutshell, what we want to do is modify Gatsby's Webpack configuration when running the build script in order to disable source maps if the environment is production.
Most JavaScript and CSS sources are usually minified and source maps serve as a memory map to the compressed files. It's generally a good practice to minify and combine your assets (Javascript & CSS) when deploying to production.
Open Developer Tools, go to "Settings" for Developer Tools, then uncheck Enable JavaScript Sourcemaps under the "Sources" settings.
js (commonly referred to as Vue; pronounced "view") is an open-source model–view–viewmodel front end JavaScript framework for building user interfaces and single-page applications. It was created by Evan You, and is maintained by him and the rest of the active core team members.
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 };
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With