const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');

module.exports = {
  entry: [
    path.resolve(__dirname, './src/main')
  ],
  output: {
    path: path.resolve(__dirname, './public'),
    filename: 'bundle.js'
  },
  module: {
    loaders: [
      { test: /\.css/, loader: 'style!css!postcss' },
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        loaders: ['babel'],
      },
      { test: /\.less/, loader: 'style!css!postcss!less-loader' },
      { test: /\.jade$/, loader: 'ractive!jade-html' },
      { test: /\.json/, loader: 'json-loader' },
      { test: /\.html/, loader: 'ractive' }
    ]
  },
  plugins: [
    new webpack.optimize.OccurrenceOrderPlugin(),
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify('production')
      }
    }),
    new webpack.LoaderOptionsPlugin({
      postcss: [
        autoprefixer({ browsers: ['last 2 versions'] })
      ]
    }),
    new webpack.optimize.UglifyJsPlugin({
      compressor: {
        warnings: false
      }
    })
  ],
  resolve: {
    alias: {
      pubsub: 'aurelia-event-aggregator',
      Ractive: 'ractive'
    }
  }
};

@@ -337,28 +337,42 @@
 : 'style
-!css
+-loader!css-loader
 !postcss
 ' %7D,%0A   
@@ -363,16 +363,23 @@
 !postcss
+-loader
 ' %7D,%0A   
@@ -465,16 +465,23 @@
  %5B'babel
+-loader
 '%5D,%0A    
@@ -527,20 +527,34 @@
 tyle
-!css
+-loader!css-loader
 !postcss
 !les
@@ -549,16 +549,23 @@
 !postcss
+-loader
 !less-lo
@@ -614,16 +614,23 @@
 'ractive
+-loader
 !jade-ht
@@ -631,16 +631,23 @@
 ade-html
+-loader
 ' %7D,%0A   
@@ -732,16 +732,23 @@
 'ractive
+-loader
 ' %7D%0A    

Correct loaders with latest webpack beta