const BASE_URL = '/live/';
const BUILD_DIST = 'PROD';  //TEST  PRE PROD
export default {
  buildDir: 'nuxt-dist',
  env: {
    baseUrl: BASE_URL,
    X_CA_STAGE: BUILD_DIST != "PROD" ? BUILD_DIST : ''
  },
  router: {
    base: BASE_URL,
    middleware: ["device"],
  },
  mode: 'universal',
  /*
  ** Headers of the page
  */
  head: {
    title: process.env.npm_package_name || '',
    meta: [
      { charset: 'utf-8' },
      { "http-equiv": 'Cache-control', content: "no-store no-cache"},
      { name: 'viewport', content: 'width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no' },
      { hid: 'description', name: 'description', content: '现场直播' }
    ],
    link: [
        
    ],
    script: [
      { src: '//cdn.aodianyun.com/static/jquery/jquery-1.11.1.min.js' },
      { src: '//cdn.aodianyun.com/mps/v1/hlsplayer.js?v=xxx1717' },
      { src: '//cdn.aodianyun.com/dms/rop_client.js'},
      { src: '//res.wx.qq.com/open/js/jweixin-1.0.0.js'},
      { src: `${BASE_URL}${BUILD_DIST.toLowerCase()}/js/rms.js`,body: true},
      { src: `${BASE_URL}${BUILD_DIST.toLowerCase()}/js/web-animations.min.js`},
    ],
  },
  /*
  ** Customize the progress-bar color
  */
  loading: { color: '#fff' },
  /*
  ** Global CSS
  */
  css: [
  ],
  /*
  ** Plugins to load before mounting the App
  */
  plugins: [
    '@/plugins/main.js',
  ],
  /*
  ** Nuxt.js modules
  */
  modules: [
    // Doc: https://axios.nuxtjs.org/usage
    '@nuxtjs/axios',
    '@nuxtjs/proxy'
  ],
  axios: {
    proxy: true
  },
  proxy: {
    '/red': {
      target: 'https://red.guangdianyun.tv',
      pathRewrite: {
        '^/red' : '/'
      }
    }
  },
  /*
  ** Axios module configuration
  ** See https://axios.nuxtjs.org/options
  */
  axios: {
  },
  server: {
    port: 3000, // default: 3000
    host: '0.0.0.0' // default: localhost
  },
  /*
  ** Build configuration
  */
  build: {
    /*
    ** You can extend webpack config here
    */
    publicPath: `/${BUILD_DIST.toLowerCase()}/`,
    extend(config, ctx) {
    }
  },

}
