var path = require('path')
var webpack = require('webpack')

module.exports = {
  entry: './src/main.js',
  output: {
    path: path.resolve(__dirname, './dist'),
    publicPath: '/dist/',
    filename: 'build.js'
  },
  resolveLoader: {
    root: path.join(__dirname, 'node_modules'),
  },
  module: {
    loaders: [
      {
        test: /\.vue$/,
        loader: 'vue'
      },
      {
        test: /\.js$/,
        loader: 'babel',
        exclude: /node_modules/
      },
      {
        test: /\.css$/,
        loader: 'style!css',
        exclude: /node_modules/
      },
      {
        test: /\.scss$/,
        loaders: ['style', 'css?sourceMap', 'sass?sourceMap']
      },
      {
        test: /\.(png|jpg|gif|svg)$/,
        loader: 'url',
        query: {
          limit: 8192,
          name: '[name].[ext]?[hash:6]'
        }
      },
      {
        test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
        loader: "url-loader?limit=10000&minetype=application/font-woff"
      },
      {
        test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
        loader: "file-loader"
      }
    ]
  },
  devServer: {
    historyApiFallback: true,
    noInfo: true,
    host: '0.0.0.0',
    // quiet: true,
    contentBase: './',
    //其实很简单的，只要配置这个参数就可以了, 代理服务器地址
    proxy: {
      '/user': {
        target: 'http://192.168.253.10:8080/',
        secure: false,
        changeOrigin: true
      },
      '/growUp': {
        target: 'http://192.168.253.10:8080/',
        secure: false,
        changeOrigin: true
      }
    }
  },
  devtool: '#eval-source-map'
}

if (process.env.NODE_ENV === 'production') {
  module.exports.devtool = '#source-map'
  // http://vue-loader.vuejs.org/en/workflow/production.html
  module.exports.plugins = (module.exports.plugins || []).concat([
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: '"production"'
      }
    }),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    })
  ])
}

@@ -155,16 +155,27 @@
 /dist'),
+ // %E8%BE%93%E5%87%BA%E7%9A%84%E7%BB%9D%E5%AF%B9%E8%B7%AF%E5%BE%84
 %0A    pub
@@ -189,15 +189,51 @@
 : '/
-dist/',
+/static-o2o.360buyimg.com/dist/', // CDN %E9%85%8D%E7%BD%AE
 %0A   

add publicpath