You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.6 KiB

3 years ago
  1. /*
  2. * @Author: Haiqiang
  3. * @Date: 2021-04-09 12:05:01
  4. * @LastEditors: Haiqiang
  5. * @LastEditTime: 2021-04-13 16:11:29
  6. * @Description:
  7. */
  8. // const path = require('path')
  9. module.exports = {
  10. devServer: {
  11. // headers: {
  12. // 'Access-Control-Allow-Origin': '*'
  13. // },
  14. hot: true,
  15. port: 8088,
  16. open: true,
  17. noInfo: false,
  18. overlay: {
  19. warnings: true,
  20. errors: true
  21. }
  22. // proxy: {
  23. // '/api': {
  24. // target: 'http://nas.hzdl.biz:6224/', //代理地址,这里设置的地址会代替axios中设置的baseURL
  25. // changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  26. // ws: true, // proxy websockets
  27. // //pathRewrite方法重写url
  28. // pathRewrite: {
  29. // //'^/api': ''
  30. // // pathRewrite: {'^/api': '/api'} //重写之后url为 http://192.168.1.16:8085/xxxx
  31. // }
  32. // }
  33. // }
  34. },
  35. runtimeCompiler: true,
  36. productionSourceMap: false
  37. // 自动引入样式文件
  38. // css: {
  39. // requireModuleExtension: true,
  40. // sourceMap: true,
  41. // loaderOptions: {
  42. // scss: {
  43. // /*sass-loader 8.0语法 */
  44. // //prependData: '@import "~@/styles/variables.scss";',
  45. // /*sass-loader 9+写法 */
  46. // additionalData(content, loaderContext) {
  47. // const { resourcePath, rootContext } = loaderContext
  48. // const relativePath = path.relative(rootContext, resourcePath)
  49. // if (relativePath.replace(/\\/g, '/') !== 'src/styles/variables.scss')
  50. // return '@import "~@/styles/variables.scss";' + content
  51. // return content
  52. // },
  53. // },
  54. // },
  55. // },
  56. }