nuxt.config.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. const isProdMode = Object.is(process.env.NODE_ENV, 'production')
  2. const baseUrl = process.env.BASE_URL || (isProdMode ? 'https://city-service.ubtob.com' : 'http://10.1.51.81:8687/')
  3. const cityDomain = process.env.CITY_DOMAIN || (isProdMode ? 'thxz' : 'thxz')
  4. module.exports = {
  5. head: {
  6. title: '产城园区',
  7. meta: [
  8. { charset: 'utf-8' },
  9. { 'http-equiv': 'X-UA-Compatible', content: 'IE=edge,chrome=1' },
  10. { name: 'render', content: 'webkit' },
  11. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  12. { hid: 'description', name: 'description', content: '服务一体化' }
  13. ],
  14. link: [
  15. { rel: 'icon', type: 'image/x-icon', href: '/U.png' }
  16. ]
  17. },
  18. /*
  19. ** Customize the progress-bar color
  20. */
  21. loading: { color: '#3B8070' },
  22. /*
  23. ** Build configuration
  24. */
  25. build: {
  26. /*
  27. ** Run ESLINT on save
  28. */
  29. extend(config, { isDev }) {
  30. if (isDev && process.client) {
  31. config.module.rules.push({
  32. enforce: "pre",
  33. test: /\.(js|vue)$/,
  34. loader: "eslint-loader",
  35. exclude: /(node_modules)/
  36. })
  37. }
  38. },
  39. vendor: [
  40. 'axios',
  41. 'element-ui',
  42. 'vue-jsonp',
  43. 'vue-clipboard2'
  44. ]
  45. },
  46. css: [{src: '~assets/scss/app.scss', lang: 'scss'}],
  47. dev: !isProdMode,
  48. env: {
  49. baseUrl,
  50. cityDomain
  51. },
  52. plugins: [{
  53. src: '~plugins/axios.js'
  54. }, {
  55. src: '~plugins/city-service.js'
  56. }, {
  57. src: '~plugins/element-ui.js',
  58. },{
  59. src: "~plugins/vue-jsonp.js",
  60. ssr: false
  61. }, {
  62. src: "~plugins/vue-clipboard2.js",
  63. ssr: false
  64. }],
  65. /* TODO 暂时代理到商城测试版,之后再做出调整 */
  66. proxyTable: [
  67. '/search/**',
  68. '/user/**',
  69. '/login/**',
  70. '/register/**',
  71. '/logout/**',
  72. '/city/**',
  73. '/city/thxz/api/**',
  74. '/api/**',
  75. '/zuul/**',
  76. '/ERP/**',
  77. '/sync/**']
  78. }