const path = require('path')

function resolve (dir) {
    return path.join(__dirname,dir)
}
module.exports = {
    lintOnSave: process.env.NODE_ENV !== 'production',
    devServer:{
        open:true,
        proxy:{
            '/bridge':{
                target : 'http://10.240.116.12:10077',
                changeOrigin:true,  //需要虚拟主机站点 
                ws:true,  // 代理的WebSockets 
                pathRewrite:{
                    '^/bridge': '/'
                }
            }
        }

    },
    configureWebpack:config=>{
        if (process.env.NODE_ENV === 'production') {
            return {
                output: {
                    library:'cube-plugin',
                    libraryTarget: 'umd',
                    umdNamedDefine: true
                  },
            }
        }
        config.resolve = {
            extensions: ['.js', '.vue', '.json',".css"],
            alias: {
                'vue$': 'vue/dist/vue.esm.js',
                '@src': resolve('src'),
                '@packages': resolve('src/packages'),
              }
        }

    }
}