nuxt.config.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. const pkg = require('./package');
  2. module.exports = {
  3. mode: 'spa',
  4. env: {
  5. BASE_URL: process.env.BASE_URL,
  6. NODE_ENV: process.env.NODE_ENV
  7. },
  8. server: {
  9. host: '0.0.0.0',
  10. port: 3001
  11. },
  12. /**
  13. * 打包文件
  14. */
  15. build: {
  16. vendor: [ 'axios', 'element-ui' ]
  17. },
  18. /*
  19. ** Headers of the page
  20. */
  21. head: {
  22. title: '程序员客栈后台',
  23. meta: [
  24. { charset: 'utf-8' },
  25. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  26. { hid: 'description', name: 'description', content: '程序员客栈后台' }
  27. ],
  28. link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } ]
  29. },
  30. /*
  31. ** Customize the progress-bar color
  32. */
  33. loading: { color: '#fff' },
  34. /*
  35. ** Global CSS
  36. */
  37. css: [ 'element-ui/lib/theme-chalk/index.css', '@/assets/css/common.css', './styles/index.scss' ],
  38. /*
  39. ** Plugins to load before mounting the App
  40. */
  41. plugins: [ '@/plugins/element-ui', '@/plugins/http', '@/plugins/quill' ],
  42. /*
  43. ** Nuxt.js modules
  44. */
  45. modules: [
  46. // Doc: https://github.com/nuxt-community/axios-module#usage
  47. '@nuxtjs/axios',
  48. '@nuxtjs/proxy'
  49. ],
  50. /*
  51. ** Axios module configuration
  52. */
  53. axios: {
  54. // See https://github.com/nuxt-community/axios-module#options
  55. },
  56. /**
  57. * Proxy
  58. */
  59. proxy: [ [ '/api', { target: 'https://dev.test.proginn.com/', changeOrigin: true } ] ],
  60. /*
  61. ** Build configuration
  62. */
  63. build: {
  64. /*
  65. ** You can extend webpack config here
  66. */
  67. extend(config, ctx) {}
  68. }
  69. };