const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
    assetsDir: 'static',
    parallel: false,
    publicPath: '/smart_canteen/',
    devServer: {
        open: true,
        proxy: {
            '/smart_canteen_api': {
                target: ' http://daweilinli.com/smart_canteen_api',
                changOrigin: true,
                pathRewrite: {
                    '^/smart_canteen_api': ''
                }
            },
            '/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/'},
          ])
        ]
      }
}
