webpack.config.js 928 Bytes
var webpack = require('webpack');

module.exports = {
  devtool: 'source-map',
  debug: true,
  entry: {
    'cms': './cms.js'
  },
  output: {
    path: 'public/build',
    publicPath: 'build/',
    filename: '[name].js'
  },
  resolve: {
    // 配置第三方插件别名
    alias: {
      'ajax':__dirname+'/public/js/ajax.js',
      'jquery': __dirname + '/public/js/jquery.js',
      'underscore': __dirname + '/public/js/underscore.js'
    }
  },
  plugins: [
    // 配置全局依赖,无需再次require
    new webpack.ProvidePlugin({
      jQuery: "jquery",
      $: "jquery",
      _: 'underscore',
      Ajax:'ajax'
    })
  ],
  module: {
    loaders: [
      {
        test: /\.vue$/,
        loader: 'vue'
      },
      {
        test: /\.css$/,
        loader: 'style!css'
      }
    ],
    devServer: {
      historyApiFallback: true,
      hot: true,
      inline: true,
      progress: true
    }
  }
};