在更目录下新建webpack.config.js

module.exports= { 

entry: {
  'common' : ['./src/page/common/index.js'],
  'index' : ['./src/page/index/index.js'],
},

  output: {

    path : __dirname + '/dist/',
    publicPath : 'dev' === WEBPACK_ENV ? '/dist/' : '//s.happymmall.com/mmall-fe/dist/',
    filename : 'js/[name].js'
},
externals : {
  'jquery' : 'window.jQuery'
},
module: {
  loaders: [
    { test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader","css-loader") },
    { test: /\.(gif|png|jpg|woff|svg|eot|ttf)\??.*$/, loader: 'url-loader?limit=100&name=resource/[name].[ext]' },
    {
      test: /\.string$/,
      loader: 'html-loader',
    query : {
      minimize : true,
      removeAttributeQuotes : false
      }
    }
  ]
},
resolve : {
  alias : {
    node_modules : __dirname + '/node_modules',
    util : __dirname + '/src/util',
    page : __dirname + '/src/page',
  }
},
plugins: [
  // 独立通用模块到js/base.js
  new webpack.optimize.CommonsChunkPlugin({
    name : 'common',
    filename : 'js/base.js'
    }),
    // 把css单独打包到文件里
    new ExtractTextPlugin("css/[name].css"),
    // html模板的处理
    new HtmlWebpackPlugin(getHtmlConfig('index', '首页')),
    new HtmlWebpackPlugin(getHtmlConfig('list', '商品列表')),
  ]

}