// Webpack config for development
import webpack from 'webpack';
import path from 'path';
import config from '../config';

module.exports = {
    cache: true,
    debug: true,
    hot: false,
    devtool: 'inline-source-map',
    output: {},
	entry: {},
    module: {
		postLoaders: [{
            test: /\.js$/,
            include: path.resolve('src/'),
            loader: 'istanbul-instrumenter'
        }],
        loaders: [{
            test: /\.css$/,
            loader: 'style-loader!css-loader'
        }, {
            test: /\.png/,
            loader: 'url-loader?limit=100000'
        },  {
            test: /\.(png|jpg|jpeg|gif)$/,
            loader: 'file-loader'
        }, {
            test: /\.js?$/,
            exclude: /node_modules\/(?!phraseanet-common)/,
            loader: 'babel',
            query: {
                presets: ['es2015', 'stage-0']
            }
        }, {
            test: require.resolve('jquery-lazyload'),
            loader: "imports?this=>window"
        }, {
            test: require.resolve('phraseanet-common/src/components/tooltip'),
            loader: "imports?this=>window"
        }, {
            test: require.resolve('phraseanet-common/src/components/vendors/contextMenu'),
            loader: "imports?this=>window"
        }, {
            test: /\.json$/,
            loader: "json"
        }]
    },
    resolve: {
        extensions: ['', '.js', '.css']
    },
    externals: {
        jquery: 'jQuery',
        ui: 'jQuery.ui'
    },
    plugins: [
        new webpack.NormalModuleReplacementPlugin(/\.css$/, path.resolve('./src', './empty.js'))
    ]
};

@@ -114,16 +114,202 @@
 config';
+%0Aconst ExtractTextPlugin = require('extract-text-webpack-plugin');%0A%0A// add loader for external stylesheets:%0Avar extractCSS = new ExtractTextPlugin('%5Bname%5D.css', %7B%0A    allChunks: true%0A%7D);
 %0A%0Amodule
@@ -690,32 +690,175 @@
 r'%0A        %7D, %7B%0A
+            test: /%5C.scss$/,%0A            loader: ExtractTextPlugin.extract('css!resolve-url!sass?sourceMap', %7B publicPath: './'%7D)%0A        %7D, %7B%0A
             test
@@ -1943,16 +1943,36 @@
 ty.js'))
+,%0A        extractCSS
 %0A    %5D%0A%7D

fix karma config for css