// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path');
// 在这里做版本递增
const versiony = require('versiony');
const version = versiony.from('version.json');
const v = version.get();


module.exports = {
    // 打包编译
    build: {
        env: require('./prod.env'),
        index: path.resolve(__dirname, '../dist/index.html'),
        assetsRoot: path.resolve(__dirname, '../dist'),


        assetsSubDirectory: `static`,
        assetsPublicPath: `./`,
        productionSourceMap: true,
        productionGzip: false,
        productionGzipExtensions: ['js', 'css'],
        bundleAnalyzerReport: process.env.npm_config_report
    },

    //阿里云测试环境
    dev: {
        env: require('./dev.env'),
        port: 80,
        autoOpenBrowser: true,
        assetsSubDirectory: 'static',
        assetsPublicPath: '/',
        proxyTable: {
            '/api': {
                //生产环境
                // target: 'http://116.62.244.103:8080/',
                // target: 'http://localhost:8080/',

                //测试环境
                target: 'http://47.99.40.126:8080/',
                changeOrigin: true,
                pathRewrite: {
                    '^/api': '/'
                }
            }
        },

        // CSS Sourcemaps off by default because relative paths are "buggy"
        // with this option, according to the CSS-Loader README
        // (https://github.com/webpack/css-loader#sourcemaps)
        // In our experience, they generally work as expected,
        // just be aware of this issue when enabling this option.
        cssSourceMap: false
    }
}
