Simple steps for Vue project packaging

VIEW

-Enter commands in the project to package

npm run build

Create a vue.config.js file (placed on the outermost layer)

Insert picture description here

  • Configure inside
module.exports = {
    
    
  lintOnSave: false,
  publicPath:"./"
}
  • The printing information of the console can be forcibly hidden in the index.html of dist as follows
<script>
		console.log = function(){
    
    

		}
</script>
  • Just open the index.html file in the dist file

If there is still an error,
delete the node_modules folder and
download the dependency
npm run build package through npm i again.

Guess you like

Origin blog.csdn.net/weixin_48661063/article/details/115360047