kuanhsuh
7/12/2017 - 5:56 AM

webpack-r88

webpack-r88

var path = require('path');
var webpack = require('webpack');
module.exports = {
  debug: false,
  entry: {
    App: './js/App'
  },
  output: {
    path: __dirname + "\\js\\dist",
    filename: "wap/js/dist/bundle.js"
  },
  devServer: {
      proxy: {
        "/": {
          "target": {
            "host": "www.royal88-wap.local",
            "protocol": 'http:',
            "port": 80
          },
          // ignorePath: true,
          changeOrigin: true,
          secure: false
        }
      },
      hot: true,
      inline: true,
      open: true,
      port: 8083,
  },
  plugins: [
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.HotModuleReplacementPlugin(),
    new webpack.optimize.DedupePlugin(),
    // new webpack.DefinePlugin({
    //   'process.env': {
    //     'NODE_ENV': JSON.stringify('production')
    //   }
    // })
  ],
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: 'babel',
        exclude: /node_modules/,
        include: __dirname,
      }
    ]
  }
};