const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
    assetsDir: 'static',
    parallel: false,
    publicPath: '/smart_canteen/',
    devServer: {
        open: true,
        proxy: {
            '/auto': {
                target: ' http://192.168.161.224:5555/auto',
                changOrigin: true,
                pathRewrite: {
                    '^/auto': ''
                }
            },
            '/weather': {
                target: 'https://api.map.baidu.com/weather',//天气
                changOrigin: true,
                pathRewrite: {
                    '^/weather': ''
                }
            }
        }
    },
    configureWebpack: {
        plugins: [
          new CopyWebpackPlugin([
              { from: 'node_modules/@liveqing/liveplayer/dist/component/crossdomain.xml'},
              { from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer.swf'},
              { from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer-lib.min.js', to: 'js/'},
          ])
        ]
      }
}
