Upgraded to webpack3 and now I get an error

I just updated to webpack 3. This is my config file. This is a simple webpack file using react primarily.

const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = {
    entry: './index.jsx',
    context: path.resolve('src'),
    output: {
        path: path.resolve('build'),
        filename: 'bundle.js',
        publicPath: '/public/assets',
    },
    devServer: {
        historyApiFallback: {
            index: 'index.html'
        },
    },
    module: {
        rules: [
            {
                test: [/\.es6?$/, /\.jsx?/],
                exclude: /node_modules/,
                loader: 'babel-loader',
                query: {
                    presets: ['es2015', 'react', 'stage-2']
                }
            },
            {
                test: /\.scss$/,
                // eslint-disable-next-line max-len
                loader: ExtractTextPlugin.extract('style', '!css-loader?modules&localIdentName=[name]__[local]___[hash:base64:5]&sourceMap!sass?sourceMap')
            },
            {
                test: /\.svg$/,
                loader: 'url?limit=65000&mimetype=image/svg+xml&name=public/fonts/[name].[ext]'
            }
        ]
    },
    plugins: [
        new ExtractTextPlugin('styles.css')
    ],
    watch: false,
    resolve: {
        extensions: ['.js', '.jsx', '.json', '.es6', '.scss']
    },
};

Now I get the following error

throw new Error("Module '" + loader.path + "' is not a loader (must have normal or pitch function)");

How do I fix this. I think its the .svg rule that is causing this issue.

0 Comment

NO COMMENTS

LEAVE A REPLY

Captcha image