当前位置:   article > 正文

VUE中vue.config.js配置_vue vue.config.js配置

vue vue.config.js配置
  1. const { defineConfig } = require('@vue/cli-service')
  2. module.export = defineConfig({
  3. productionSourceMap: false, // 打包是否生成.map文件
  4. publicPath: 'xx.xx.xx', // 部署的URL
  5. assetsDir: 'static', // 放置静态文件
  6. outputDir: 'dist', // 打包文件名
  7. lintOnSave: true, // 开发环境提示eslint编译警告
  8. devServer: {
  9. proxy: {
  10. '/api': {
  11. target: 'http://xx.xx:80', // 代理地址
  12. timeout: 600000, // 延时时间10分钟
  13. ws: true, // 支持websocket
  14. changOrigin: true, // 运行跨域
  15. logLevel: 'debug' // 打印日志
  16. },
  17. },
  18. hot: true, // 热更新
  19. port: '80', // 开发端口
  20. open: true, // 打开浏览器
  21. },
  22. transpileDependencies: true, // 对transpileDependencies: ['vue-echarts']中的依赖进行编译
  23. runtimecompiler: true, // 对template模板内容进行编译
  24. pluginOptions: { // less预处理器
  25. 'style-resources-loader': {
  26. preProcessor: 'less',
  27. // 要注入的资源的路径,需要用绝对路径
  28. patterns: [
  29. path.join(__dirname, './src/assets/styles/variables.less'),
  30. path.join(__dirname, './src/assets/styles/mixins.less')
  31. ]
  32. }
  33. },
  34. css: { // css设置全局样式
  35. requireModuleExtension: true,
  36. sourceMap: true,
  37. loaderOptions: {
  38. less: {
  39. lessOptions:{
  40. javaScriptEnabled: true,
  41. }
  42. }
  43. }
  44. }
  45. })

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/320648?site
推荐阅读
相关标签
  

闽ICP备14008679号