In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Today, I will talk to you about how to carry out vue cli3 configuration development and testing environment, many people may not know much, in order to let everyone know more, Xiaobian summarized the following content for everyone, I hope you can harvest according to this article.
CLI3 Create vue project is a simplified version of the build and config files, so configure the development environment, test environment, production environment, then you need to create your own env file.
vue-cli3 Configure development environment, test environment, online environment
Add to package.json file
"scripts":{
"serve":"vue-cli-serviceserve",//invoke development api
"build":"vue-cli-servicebuild",//online
"test":"vue-cli-servicebuild--modetest",//content to be added, test
},
Create an.env file in the root directory and configure
NODE_ENV='production'
VUE_APP_FLAG='pro'//vue code can be used directly with VUE_APP_name
Create an.env.test file in the root directory
NODE_ENV='production'
VUE_APP_FLAG='test'
outputDir=test//You can change the directory name output when packaging, the default is dist
Create vue.config.js in the root directory
vue-cli3 copy code
module.express={
baseUrl:process.env.NODE_ENV==='production'? '/static/':'./ ',
devServe:{
port:8080,
//disableHostCheck:true,//handle host not recognized problem
},
baseUrl:'/',//Basic path, do not change it at will
outputDir:process.env.outputDir,//package generation directory
assetDir:'static',
lintOnSave:false,
runtimeCompiler:true,//whether to use Vue build with runtime compiler
productionSourceMap:false,//sourcemap of production environment
}
After reading the above, do you have any further understanding of how to configure vue cli3 development and test environment? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.